I'm doing a data analysis course, currently working on Python and have gotten stuck on a point where I have to "find which month has the biggest sale" in the dataset.
Initially this wasn't too much of a problem and was easy enough to find, but the next task requires me to turn the findings into a stacked bar chart which I'd imagine needs more than one row of data so I'm trying to find the highest sale made in between each month instead.
I'm not necessarily looking for the exact answer, but appreciate any kind of advice that people can give.
df.loc[df['SalePrice'].idxmax()]
I've used this to just find the highest sale in the dataset, which returns the right row, but I'm at a loss on how to do this for each month.
This is a snippet of the data. There are more columns, but I think these are the only relevant ones for what I'm looking for.
I have used res.groupby(['SaleDate'], as_index=False)['SalePrice'].max()
, but this shows every date in the dataset and I'm just looking for each month.