scikit learn – Create X train and Y Train for CSV dataset in Python

This seems a general question, but I can answer with:

You can use following block to import these csv files in your env.

import pandas as pd # for CSV file I/O operations
train = pd.read_csv('../input/data_train.csv')
test = pd.read_csv('../input/data_test.csv')

I did not see your .csv files but it must be:

# x is features, y is your target column
x_train = train.loc[:,1:] 
y_train = train.loc[:,0]

x_test = test.loc[:,1:] 
y_test = test.loc[:,0]

So, you can obtain the x and y values, if it is not working please open your .csv and parse the coordinates accordingly 🙂

Read more here: Source link