Find Max from each column in dataframe
How can I get the maximum value from a dataframe using pandas?
df = pd.DataFrame({'one' : [0,1,3,2,0,1],'two' : [0,5,1,0,1,1]})
I use:
df1=df.max()
This gives the correct result, but the format of the dataframe changes
I want to keep the original data format as shown below:
df1 = pd.DataFrame({'one' : [3],'two' : [5]})
+3
source to share