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...
阿神2017-06-30 10:02:20
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.