Reputation: 702
I tried to convert the data frame to series But it shows the following error. I used pandas.Series(Dataframe) -> to convert Dataframe to series
I want a output in the format of 1st image
Upvotes: 3
Views: 23577
Reputation: 649
Please try the following approach to get a Series object from mentioned data(assuming data
is the DataFrame you're using)
series = pd.Series(data['Sales'], index=data.index)
Hope that helps.
Upvotes: 10