[英]comparing values of 2 columns from same pandas dataframe & returning value of 3rd column based on comparison
[英]How to group together rows of Pandas Dataframe with same values in first 2 columns by summing values in the 3rd column?
你只需要這樣做, False
而不是True
:
df.groupby(['col1', 'col2'], axis=0, as_index=False).sum()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.