eland.Series.mode#
- Series.mode(es_size: int = 10) Series #
计算序列的众数
参数#
- es_size: 默认值为 10
如果众数有多个值,则返回的行数
另请参阅#
示例#
>>> ed_ecommerce = ed.DataFrame('http://localhost:9200', 'ecommerce') >>> ed_ecommerce["day_of_week"].mode() 0 Thursday Name: day_of_week, dtype: object
>>> ed_ecommerce["order_date"].mode() 0 2016-12-02 20:36:58 1 2016-12-04 23:44:10 2 2016-12-08 06:21:36 3 2016-12-08 09:38:53 4 2016-12-12 11:38:24 5 2016-12-12 19:46:34 6 2016-12-14 18:00:00 7 2016-12-15 11:38:24 8 2016-12-22 19:39:22 9 2016-12-24 06:21:36 Name: order_date, dtype: datetime64[ns]
>>> ed_ecommerce["order_date"].mode(es_size=3) 0 2016-12-02 20:36:58 1 2016-12-04 23:44:10 2 2016-12-08 06:21:36 Name: order_date, dtype: datetime64[ns]