Exact string match str.count(), pandas python

前端 未结 1 844
小蘑菇
小蘑菇 2021-01-25 10:48

Counting the column contents for each category, have a set of categories

  1. Male-Cat,
  2. Female-Cat,
  3. Male-Cat-Female

With df.temp.

1条回答
  •  盖世英雄少女心
    2021-01-25 11:15

    You need use regex from here:

    df['count'] = df.temp.str.count(r'(?

    0 讨论(0)
提交回复
热议问题