Series.mode

Series.mode(os_size: int = 10) Series[source]

Calculate mode of a series

Parameters

os_size: default 10

number of rows to be returned if mode has multiple values

See Also

:pandas_api_docs:`pandas.Series.mode`

Examples

>>> from tests import OPENSEARCH_TEST_CLIENT
>>> oml_ecommerce = oml.DataFrame(OPENSEARCH_TEST_CLIENT, 'ecommerce')
>>> oml_ecommerce["day_of_week"].mode()
0    Thursday
Name: day_of_week, dtype: object
>>> oml_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]
>>> oml_ecommerce["order_date"].mode(os_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]