Sum of a column if it contains multiple strings

前端 未结 0 1033
误落风尘
误落风尘 2021-01-19 00:51

I want to get the sum of a column based on whether it matches multiple strings. For example,

pd.DataFrame({\'key\': [\'b\', \'b\', \'a\', \'c\', \'a\', \'b\'],

相关标签:
回答
  • 消灭零回复
提交回复
热议问题