Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- df = pd.read_csv('t.csv')
- max_df = df[['city', 'temperature']].groupby('city').max().reset_index()
- pd.merge(max_df, df[['city', 'temperature', 'windspeed']], how='inner', on=['city', 'temperature'])
- city_and_max_temp = data.groupby('city').agg('max')[['temperature']]
- data.merge( right=city_and_max_temp ,how='inner')[['city','windspeed']]
Add Comment
Please, Sign In to add comment