Reputation: 155
I am new in pandas and having a problem Failed to convert String to float while reading csv file using pandas,i have used so far
pd.read_csv('Book2.csv',delimiter=',', index_col=0, skiprows=1,converters={'Open Price (Rs.)':float})
and tried dtype also
both gives an error I am sharing the csv file link: https://drive.google.com/open?id=0B_RSbeIckLLeRlByUlhxUGJ2dWc
Upvotes: 1
Views: 672
Reputation: 210812
Check line 1873 in the CSV file - it has a header line (column labels).
Upvotes: 2
Reputation: 1344
You can do
modelFeatures = [contains all the columns' names you use]
df = df[modelFeatures].astype(float)
Upvotes: 1