return max value from panda dataframe as a whole, not based on column or rows

后端 未结 5 2011
离开以前
离开以前 2020-11-27 21:34

I am trying to get the max value from a panda dataframe as whole. I am not interested in what row or column it came from. I am just interested in a single max value within t

5条回答
  •  臣服心动
    2020-11-27 21:59

    Hi the simplest answer is the following. Answer:

    df.max().max()
    

    Explanation:
    series = df.max() give you a Series containing the maximum values for each column.
    Therefore series.max()gives you the maximum for the whole dataframe.

    :) best answers are usually the simplest

提交回复
热议问题