how to prepare independent and dependent variables from dataframe

Solutions on MaxInterview for how to prepare independent and dependent variables from dataframe by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
showing results for - "how to prepare independent and dependent variables from dataframe"
Yanis
21 Jun 2020
1# Independent variables
2X = df.iloc[:, :-1].values
3print(X)
4
5# dependent variable y
6y = df.iloc[:,-1].values
7y