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

后端 未结 5 2012
离开以前
离开以前 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

    For the max, check the previous answer... For the max of the values use e.g.:

    val_cols = [c for c in df.columns if c.startswith('val')]
    print df[val_cols].max()
    

提交回复
热议问题