输入:
dfB=pd.qcut(dfA, 4, labels=quartiles)
输出:
Label
G 5309 3rd quartile to max
6016 1st quartile to median
5587 min to 1st quartile
PG 6687 3rd quartile to max
5943 median to 3rd quartile
5987 median to 3rd quartile
PG-13 6380 3rd quartile to max
5954 3rd quartile to max
6624 3rd quartile to max
R 6616 median to 3rd quartile
6184 median to 3rd quartile
5569 1st quartile to median
我正在尝试创建一个条形图,以可视化每个Label组(G,PG,PG-13,R)的每个四分位数类别的value_count()。下面的代码生成一个条形图,该条形图仅显示每个四分位数类别的value_count()。我不确定如何创建将每个Label组都考虑在内的堆叠条形图?
dfB.value_counts().plot.bar()