[Tutor] pandas

banda gunda bandagunda at hotmail.com
Tue Feb 20 10:18:30 EST 2018


Dear tutor,


python3

pandas


The function below returns the maximum cost row of the df.


def maximum():
    return [df.loc[df['cost'].idxmax()]]

 maximum()


But I am only interested in specific column of the df.

How could I extract from the returned row of the df?


Thanks in advance.

Best.

banda



More information about the Tutor mailing list