-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Regression for pd.Series.replace(np.nan, inplace=True) #5319
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
Comments
|
So this is working for you now? (Despite the confusing error message) Regardless that TypeError doesn't make sense, how can to_replace simultaneously be None and also potentially a list... I might take a glance at some point. |
Its type depends on the other arguments. To replace could be none if you pass a string to regex. |
I can take a look tonight |
I think I know what the issue is. |
Filter is unrlated to this |
The literal text says that to_replace is None and to_replace is not a list. First statement always implies the second right? |
And type error is valid there. This is a bug that is incorrectly triggering a typewrror |
Oh I c. Yup that is an error reporting big :) |
Actually I'm surprised this isn't covered. It's such a simple case. |
But: Why is this a bug now and was working in 0.12? What DID change? |
in 0.13, Series went from a sub-class of ndarray to a sub-class of NDFrame (which sub-class the rest of pandas objects). As a result we were able to move most methods to a generic class, and have consisten type signatures for all objects. In this case, this the frame method was much more complete and accepts much more input. This is merely a validation issue, AFAIK. @cpcloud will address shortly. see here: http://pandas.pydata.org/pandas-docs/dev/whatsnew.html#internal-refactoring |
Bump. This is still an API change (at least for me), because before, |
@cpcloud what did we decide about this? |
is this still broken? i can't really test right now ... can look later |
oh i c, nvm |
this should work, so it's a bug |
@cpcloud @michaelaye see #5600 The DataFrame case always raised a |
Don't get me wrong, I don't insist on it working as a scalar, as it is obvious that in many cases pandas requires a container as parameter. I just would like to freeze the type on my end the way it is supposed to be and go ahead. |
I think for compat it should (as it did in 0.12), the PR fixes this, no? |
How do I check an unmerged pull request? Would I have to fork your pandas fork? |
@michaelaye you need to pull it down from @jreback 's branch: git remote add jreback https://www.github.com/jreback/pandas.git
git fetch jreback
git checkout -t jreback/replace_api
# build/install |
Great, thanks! |
This code was working in pd 0.12.0, but is failing in current master ('0.12.0-955-ga96cd66'):
The error:
I saw that some filter related stuff was updated to use regex for 0.13dev, but I don't understand why this makes my command failing?
The text was updated successfully, but these errors were encountered: