Last answered:

16 Jun 2022

Posted on:

15 Jun 2022

0

How do I assign x, y in a dataframe?

This example does not have the column names for the dataset. For a dataframe where I have column names, how do I assign x and y? Thanks.

2 answers ( 0 marked as helpful)
Instructor
Posted on:

16 Jun 2022

0

Hi,

Sklearn is build to handle dataframes, including the column names. Thus, you can set your X and y variables to be the portions of the dataframe that you are interested in (one way to do is with .iloc) with the column names themselves.

Hope this helps! Let me know if you have further questions.

Best,
Nikola, 365 Team

Posted on:

16 Jun 2022

0

Can you send me an example of the codes? Thanks!

Submit an answer