I want to create a lineplot showing the commuted sales per publisher per year. For this I want to group per year and per publisher before but then I have no indexes anymore.
sales_per_year = df.groupby(['Publisher', 'Year'], as_index=False)['Global_Sales'].cumsum()
sns.lineplot(data=sales_per_year, x='Year', y='Global_Sales', hue='Platform')
Global_Sales | |
---|---|
0 | 82.74 |
1 | 40.24 |
2 | 35.82 |
3 | 33.00 |
4 | 31.37 |