Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

string contains method doesn't respect na argument #2806

hayd opened this Issue Feb 6, 2013 · 1 comment


None yet
2 participants

hayd commented Feb 6, 2013

It seems that the argument na doesn't remove the NaN with str.contains (see previous issue).

Using similar to example in test added for na functionality:

In [1]: values = Series(['om', NA, 'foo_nom', 'nom', 'bar_foo', NA, 'foo'])

In [2]: values.str.contains('foo', na=False)
0    False
1      NaN
2     True
3    False
4     True
5      NaN
6     True

In [3]: values.str.startswith('foo', na=False)
0    False
1    False
2     True
3    False
4    False
5    False
6     True

From Stackoverflow question.


y-p commented Mar 14, 2013

closed via 024c97c

@y-p y-p closed this Mar 14, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment