Units Cost Year Week Category
20224 100000 2023 24 Apple
30114 150000 2024 24 Orange
35000 175000 2023 15 Orange
10000 200000 2023 14 Apple
I want to show the sum of units, cost per unit by week. I am using below
ax = df['Year'].value_counts().head(10).plot(kind = 'bar', title = 'Top years')
ax.set_xlabel('Years')
df.ax.set_ylabel('Years')
But this is only giving me the count of the number of years. I want to show
Sum(units) —>
NOT count(Year) —>