Python sns.catplot分组的总和

2024-05-17 13:29:14 发布

您现在位置:Python中文网/ 问答频道 /正文

尝试对所有分钟进行求和

仅执行数据帧时-仅接收第一个值

sns.catplot(x="hour", hue="VehicleType", kind="count",
        palette="pastel", edgecolor=".6",
        data=df_test);

enter image description here

当使用group by时(这就是我想要看到的)-获得最大值1

sns.catplot(x="hour", hue="VehicleType", kind="count",
        palette="pastel", edgecolor=".6",
        data=df_hour_group);

enter image description here

如何在24小时内按2个类别的总和显示组

提前谢谢你


Tags: imagedfdatacountdescriptionhueentersns