-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: series replace should allow a single list #4748
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
Conversation
_fill_methods = {'pad': com.pad_1d, 'backfill': com.backfill_1d} | ||
|
||
|
||
def _get_fill_func(method): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel this exists somewhere already in common?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm. i can't find it after grin
ing for method
and backfill
, i don't see anything similar...this was in the 0.12 release but not sure when it was removed...should i move to common.py
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would put it in common ; i will look for this too
@jreback this ok 2 merge? or did u find a |
I don't think this will work if you pass odd dtypes eg 'a' to an int series or something ; maybe put some tests that change dtype on purpose |
fyi...may want to move some of your tests to test_generic.py |
is it ok if i move in a separate pr? |
re strange
but mixing things works
|
sep PR for tests ok.... what I mean is, just some confirming tests....
note the last one; I am not sure we can do much about that (well we can but only if you use Block.setitem, where I attempt to see if you are using a bool and do the right thing)....but too much work really |
ah ok |
@jreback this ok? |
I guess I don't understand how this works
so the 1,2,3 are all replaced by 0? (shouldn't it be |
It's treating |
ic....so tantamount to |
ok then |
Yes. In fact, that's what I was doing, but then dtype is not preserved (in cases where it can be) |
cool...go ahead then |
This requires adding the ``method`` keyword parameter back in.
BUG: series replace should allow a single list
in test_series.py
This fails on 32-bit because s is int32 (and expected is int64) as the numpy arrays pass thru the dtype :) I am just going to fix it in a PR I am doing. FYI |
ah ok ... cool thanks |
Also reverts the
method
parameter ofNDFrame.replace()
deprecationcloses #4743