2

I know how to find in a Dataframe the max and minimum value of a column:

df.min()
df.max()

If I want to find the min and max values by row is:

df.max(index=1)
df.max(index=1)

But this return a list with the respective row or column value. I want to find the minimum or maximum value of all the dataset, only one value.

I was thinking try to iterate by row and column finding the max value But I see here that this is anti-pattern for pandas.

I am thinking in a function that only output me a value with the respective location. This function exist or I need to create?

I research answer here and not find anything related.

rubengavidia0x
  • 501
  • 1
  • 5
  • 18

1 Answers1

3

You can try:

max_val = df.max().max()
Muhammad Hassan
  • 4,079
  • 1
  • 13
  • 27