python - How to use mode() in pandas?
大家讲道理
大家讲道理 2017-06-30 10:00:20
0
1
1602

As shown in the title, how to use mode() in pandas? I didn’t understand the official introduction, as follows

>>> df = pd.DataFrame({'A': [1, 2, 1, 2, 1, 2, 3]})
>>> df.mode()
   A
0  1
1  2

http://pandas.pydata.org/pand...

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(1)
阿神

mode should be the mode, which is the one with the highest frequency. In the example, 1 and 2 both appear three times, which are the most frequent, so these two numbers are returned.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template