# Independent variables X = df.iloc[:, :-1].values print(X)  # dependent variable y y = df.iloc[:,-1].values y

Read more of this post