How to get the max/min value in Pandas DataFrame when nan value in it

前端 未结 6 917
萌比男神i
萌比男神i 2021-01-01 19:07

Since one column of my pandas dataframe has nan value, so when I want to get the max value of that column, it just return error.

>>> d         


        
6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-01 19:54

    When the df contains NaN values it reports NaN values, Using np.nanmax(df.values) gave the desired answer.

提交回复
热议问题