Miles Bennet Dyson
Miles Bennet Dyson

Reputation: 141

How to plot seaborn with pandas multi index

I am trying to efficiently plot the number of orders in a seaborn line plot. Here the x-axis should be the date, the y-axis the number_of_orders and there should be a total of 12 lines that correspond to each individual group.

The data I'm working with looks like this. It is a multi index pandas dataframe, where there are several groups for each single date.

enter image description here

Is there an easy way of doing this?

An example on how I want it to look like is this: enter image description here

Upvotes: 0

Views: 1388

Answers (1)

slb20
slb20

Reputation: 139

try something like this:

sns.lineplot(data=yourDF, x="Date", y="number of orders", hue="Group")

Upvotes: 1

Related Questions