Skip to content

Instantly share code, notes, and snippets.

@arunm8489
Created July 31, 2020 14:03
Show Gist options
  • Save arunm8489/4ab4aa9ce9f0cb50dbd81d89bd57c705 to your computer and use it in GitHub Desktop.
Save arunm8489/4ab4aa9ce9f0cb50dbd81d89bd57c705 to your computer and use it in GitHub Desktop.
price_data = resources.groupby('id').agg({'price':'sum', 'quantity':'sum'}).reset_index()
# join two dataframes in python:
data = pd.merge(data, price_data, on='id', how='left')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment