在python中计算平均值、中值和模式

2024-10-02 02:29:44 发布

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

如果数据具有属性Jumlah_individu,如何使用python3计算pandas列上的中心趋势(中值和模式)?在

this is my code to calculate mean (I have get it) but for median and mode I can't


Tags: 数据pandas属性模式中心趋势python3jumlah
2条回答

您可以使用.median()来获取列表中的中间值。在

例如df['Jumlah_individu'].median()

您可以使用.mode()来获取列表中的最高频率值。在

例如df['Jumlah_individu'].mode()[0]其中{}以获得最高频率值。在

只需尝试data.describe(),就可以得到如图所示的列表

相关问题 更多 >

    热门问题