iloc return type code example
Example 1: iloc in dataframe
df=pd.read_csv('yourcsv.csv')
X=df.iloc[:,:-1].values
y=df.iloc[:,1].values
Example 2: how to use loc and iloc in pandas
>>> df.iloc[0, 1]
2
df=pd.read_csv('yourcsv.csv')
X=df.iloc[:,:-1].values
y=df.iloc[:,1].values
>>> df.iloc[0, 1]
2