我正在使用以下代码进行多个图表可视化:
data.groupby(['y', 'y']).size().unstack().plot(kind='bar', stacked=True, ax=plt.subplot(6,2,2+1),figsize=(15,25))
但是出现以下错误:
Duplicated level name: "y", assigned to level 1, is already used for level 0.
而如果我为其他变量编写上述相同的代码,例如:
data.groupby(['otherObj', 'y']).size().unstack().plot(kind='bar', stacked=True, ax=plt.subplot(6,2,2+1),figsize=(15,25))
上面的错误如何排序?