Issue
When I use df.Column[] it replaces the value with name
Solution
First question: Does the .xls file has column names? Or should you define them manually?
If it has column names (it seems like it doesn't), you can use header = 0 .If it doesn't have column names, define a list and then header = None and names = column_names.
The first one is;
df = pd.read_excel('wine-1.xls', header = 0 ) # use read_excel instead of read_csv
and the second one:
column_names = ['wine', 'acidity',...] # list of column names
df = pd.read_excel('wine-1.xls', header = None, names = columns_names)
Hope that works for you.
Answered By - Orkun Aran
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.