You should not have to modify your dataframe just to plot it in a certain way right ?
Use seaborn !
import seaborn as sns
sns.catplot(x = "x", # x variable name
y = "y", # y variable name
hue = "type", # group variable name
data = df, # dataframe to plot
kind = "bar")
source