Izo
Izo

Reputation: 31

How to read Pandas data header when it splitted in columens like xls

I have a pandas dataframe which is splitted in columens like xls file and when I tried to get the header using list(pd.read_csv(path)) I got a list with one string like ['header1;header2;header3;......'] How can I got the header in list of strings ['header1','header2','header3',....]

Upvotes: 0

Views: 34

Answers (1)

PRIN
PRIN

Reputation: 344

I think you haven't defined the separator with your path. It should be:

pd.read_csv(path, sep = ';')

Upvotes: 1

Related Questions