Alternate Solution for finding Max Employees / Idxmax with dataframes

I suppose there are so many ways to solve anything.

I ended up using idxmax to extract the position. Is there any way to skip the intemediate step of creating japan_employees? Can I use idxmax levels? I couldn’t quite get it to work. the following worked fine:

japan_employees=f500.loc[bool_japan,‘employees’]
top_japanese_employer=f500.iloc[japan_employees.idxmax()][‘company’]

1 Like

Hey @kevinjhuang, thanks for sharing this!

Can you please also add a link to the screen that this solution belongs to? That would be very helpful. :slight_smile: