saravanan saminathan
saravanan saminathan

Reputation: 702

Convert dataframe to series for multiple column

This is also a dataset contain 2 dimension but it is series typeConvert dat frame to series

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

Answers (1)

yogkm
yogkm

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

Related Questions