Find Max from each column in data frame Find Max from each column in data frame pandas pandas

Find Max from each column in data frame


option 1
pandas with to_frame and transpose

df.max().to_frame().T# pd.DataFrame(df.max()).T   one  two0    3    5

option 2
numpy with [None, :] and pd.DataFrame constructor

pd.DataFrame(df.values.max(0)[None, :], columns=df.columns)   one  two0    3    5