我在计算序列中的周期数时出错。我已经尝试过了
series = pd.Series(['how. are. you. today.', 'i. am. fine.', 'thank. you.'])
count = series.str.count('.')
预期结果是
0 4
1 3
2 2
但是我却得到了
0 21
1 12
2 11
我该如何解决?预先谢谢你。
series = pd.Series(['how. are. you. today.', 'i. am. fine.', 'thank. you.'])
count = series.str.count('\.')