Skip to content

FIX str.match uses na flag #6611

New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 14, 2014
Merged

FIX str.match uses na flag #6611

merged 1 commit into from
Mar 14, 2014

Conversation

hayd
Copy link
Contributor

@hayd hayd commented Mar 12, 2014

fixes #6609

@hayd hayd added this to the 0.14.0 milestone Mar 12, 2014
@hayd
Copy link
Contributor Author

hayd commented Mar 12, 2014

travis failing is a refused connection with fred, unrelated to this pr (you'd think)

https://travis-ci.org/pydata/pandas/jobs/20585139

@jreback
Copy link
Contributor

jreback commented Mar 12, 2014

hmm are the Fred calls wrapped with network. decorator?
that should catch and skip those tests

@jreback
Copy link
Contributor

jreback commented Mar 12, 2014

actually these network errors are 'ok'. because in theory if the URL had changed that's what we'd get

so if it keeps repeating....can investigate further

@jorisvandenbossche
Copy link
Member

I was wondering, should it be noted in the docstring that by default it gives NaN for non-strings? (because you could also assume this gives False)

@hayd
Copy link
Contributor Author

hayd commented Mar 12, 2014

@jorisvandenbossche this fix makes it inline with the current behaviour of contains (et al?), I guess we could change the docstring too (not sure which others this is used in).

...tbh I had assumed that it was equivalent to s.astype(str).str.contains(...) but they aren't (i.e. you can't search for digits of a number).

@hayd
Copy link
Contributor Author

hayd commented Mar 12, 2014

(re fred, this branch passed on hayd/travis, so it's something intermittent)

@hayd
Copy link
Contributor Author

hayd commented Mar 13, 2014

@jorisvandenbossche I kind of think I should merge this in first, then have sep issue for the docstring. Maybe adding it to docs example of vectorised string methods would be enough...

Oh goodness, when I implemented get_dummies I used .astype(str) to get around this problem, I had assumed this was how they all worked... I suspect that's going to raise sometimes? :s

hayd added a commit that referenced this pull request Mar 14, 2014
@hayd hayd merged commit 03743af into pandas-dev:master Mar 14, 2014
@hayd hayd deleted the str_match_nan branch March 14, 2014 06:18
@jorisvandenbossche
Copy link
Member

Yeah, but I would certainly add something to the docs, since you also expected non-strings to be converted to strings instead of giving NaN.

@jorisvandenbossche
Copy link
Member

For further discussion see also #6634

@hayd
Copy link
Contributor Author

hayd commented Mar 14, 2014

What's weird is that I'm still convinced I'd tested it (on the other methods)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Strings String extension data type and string data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

string match returns NaN on non strings
3 participants