Skip to content

Instantly share code, notes, and snippets.

@kurasaiteja
Created March 13, 2021 15:25
Show Gist options
  • Save kurasaiteja/2f0497fa7bcc93ae54f4ce039439d485 to your computer and use it in GitHub Desktop.
Save kurasaiteja/2f0497fa7bcc93ae54f4ce039439d485 to your computer and use it in GitHub Desktop.
def aggregate(df: pd.Series, agg_col: str) -> pd.DataFrame:
data = df.groupby("country")[agg_col].max()
data = pd.DataFrame(data)
return data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment