Finding max /min value of individual columns

SeleCoder picture SeleCoder · Oct 30, 2017 · Viewed 9.9k times · Source

I am a beginner to Data Analysis using Python and stuck on the following:

I want to find maximum value from individual columns (pandas.dataframe) using Broadcasting /Vectorization methodology.

A snapshot of my data Frame is as follows:enter image description here

Answer

陳耀融 picture 陳耀融 · Oct 30, 2017

you can use pandas.DataFrame built-in function max and min to find it

example

df = pandas.DataFrame(randn(4,4))
df.max(axis=0) # will return max value of each column
df.max(axis=0)['AAL'] # column AAL's max
df.max(axis=1) # will return max value of each row

or another way just find that column you want and call max

df = pandas.DataFrame(randn(4,4))
df['AAL'].max()
df['AAP'].min()

min is the same