pandas str.contains is not showing any functions

Viewed 25

Gents/Ladies,

When trying the following example from google:

import pandas
import numpy as np
import re

s1 = pandas.Series(['Mouse', 'dog', 'house and parrot', '23', np.NaN])
s1.str.<No functions available>

The 2nd line has only those function options:

print
ifn
not
par
if
ifnn
main
return
while

I've tried everything and can't understand why str.x functions are not available?

1 Answers

The functions are there. It is probably issue with the IDE that you are working. You can try this and see if it runs.

>>> s1.str.count("o")
0    1.0
1    1.0
2    2.0
3    0.0
4    NaN
dtype: float64
Related