小编Shi*_*nde的帖子

How to sum dataframe in pandas for more than 5

in my days column if my number is more than 5 I want to sum that column

Input:

Days  files 
1      10
3      20
4      30
5      40
6      50
Run Code Online (Sandbox Code Playgroud)

Required output:

Days  files 
1      10
3      20
4      30
5+     90
Run Code Online (Sandbox Code Playgroud)

python sum pandas pandas-groupby

4
推荐指数
1
解决办法
67
查看次数

标签 统计

pandas ×1

pandas-groupby ×1

python ×1

sum ×1