I have data in csv file without header. I need to parse some columns.
A part of data:
-1.0,-0.0246259814315,1174.60023796
1.0,-0.978057706084,1083.19880269
-1.0,0.314271994507,-1472.97760911
-1.0,0.179751565771,231.017267343
1.0,-1.26254374278,-778.271726463
-1.0,0.249969939456,-52.8014826538
1.0,-1.87039747875,-324.235348241
I need to load only second and third columns. I use train_X = pd.read_csv("perceptron-train.csv", sep=',', parse_dates=[1], usecols=[2, 3]) but it returns IndexError: list index out of range
train_X = pd.read_csv("perception-train.csv", parse_dates=[1])also for usecols you should pass a list of either the names or ordinal positions of the columnsparse_dates=[1]and keep in mind that the column-indices are zero-based.