I'm trying to plot three dataframe based on their Total Activity Hours Per Month so I used the groupby function.
df110 = df[df['Attendance Abs Type Code'] == '110']
df120 = df[df['Attendance Abs Type Code'] == '120']
dfWithout110 = df[df['Attendance Abs Type Code'] != '110 ']
dfWithout110120 = dfWithout110[dfWithout110['Attendance Abs Type Code'] != '120']
dfWithout110120Chart = dfWithout110120[["Activity Hours"]].groupby(dfWithout110120["Activity Month"]).sum().plot(kind='bar', width=0.8, title="Total activity hours per month (Without 110 & 120)")
df110chart = df110[["Activity Hours"]].groupby(df110["Activity Month"]).sum().plot(kind='bar', width=0.8, title="Total activity hours per month (110 only)")
df120chart = df120[["Activity Hours"]].groupby(df120["Activity Month"]).sum().plot(kind='bar', title="Total activity hours per month (120 only)")
Download link for the dataset https://drive.google.com/file/d/1YdSsP8BM4PVNh8m2kW7244NOo75lNUT7/view?usp=sharing
Here is some sample data from the dataframe:
Please take a look at the attached picture.
What I really wanted is actually a stacked barchart like this:


