Created
November 8, 2023 10:07
-
-
Save do-me/07f78e9812df3c3bfdd6b0731966c05f to your computer and use it in GitHub Desktop.
Simple pandas groupby with sum
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| df = pd.read_csv("your_file.csv") | |
| df = df.groupby(["all","columns","you","need_for_grouping"])['value_for_sum'].sum().reset_index() | |
| df |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment