find and select the most frequent data of column in pandas DataFrame

后端 未结 3 716
别跟我提以往
别跟我提以往 2021-01-12 09:33

I have a dataframe with the following column:

file[\'DirViento\']

Fecha
2011-01-01    ENE
2011-01-02    ENE
2011-01-03    ENE
2011-01-04    NNE 
2011-01-05          


        
3条回答
  •  孤街浪徒
    2021-01-12 10:02

    1. For whole dataframe, you can use:

      dataframe.mode()
      
    2. For specific column:

      dataframe.mode()['Column'][0]
      

    Second case is more useful in imputing the values.

提交回复
热议问题