1df=pd.read_csv('yourcsv.csv')
2X=df.iloc[:,:-1].values
3y=df.iloc[:,1].values
1Purely integer-location based indexing for selection by position.
2
3.iloc[] is primarily integer position based (from 0 to length-1 of the axis), but may also be used with a boolean array.