-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: #12624 where Panel.fillna() ignores inplace=True #12633
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
if inplace: | ||
new_obj = self._constructor.from_dict(result).__finalize__(self) | ||
self._update_inplace(new_obj._data) | ||
return |
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.
just do an else
here
this is duped by #12630 but your soln is nicer. Needs tests. |
Added test case in test_panel.py: test_fillna |
items=['a', 'b'], minor_axis=['x', 'y']) | ||
p2 = pd.Panel([[[0, 1], [2, 1]], [[10, 11], [12, 11]]], | ||
items=['a', 'b'], minor_axis=['x', 'y']) | ||
p1.fillna(method='ffill', inplace=True) |
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.
rename p2
-> expected
, drop the pd.
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.
do this in a loop with ffill
, bfill
pls add a whatsnew note as well. |
Test case changes:
Style changes in generic.py: |
if inplace: | ||
new_obj = self._constructor.from_dict(result).__finalize__(self) | ||
self._update_inplace(new_obj._data) | ||
return |
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.
you don't need this return
some small changes. pls add a whatsnew note. |
|
ok looks nice. if you can squash your commits would be great. pls ping on green. (not you had some PEP errors in the prior runs which cause things to fail). |
https://travis-ci.org/pydata/pandas/jobs/116251314, look at the very end |
pls also rebase on master: |
Thanks for the reminder! |
no, making lots of commits is fine (and good!). At the end we just like to squash them to a single one. |
Current coverage is
|
this needs to be squashed/rebased on master. |
I'm not sure if I'm doing it right. I'm running "git rebase -i 648b0f6" and squash all commits I made |
|
FYI, you don't want to |
I finally got the idea here. Thanks! |
ok great. ping when green. |
@@ -89,46 +89,17 @@ Bug Fixes | |||
~~~~~~~~~ | |||
|
|||
- Bug in ``Period`` and ``PeriodIndex`` creation raises ``KeyError`` if ``freq="Minute"`` is specified. Note that "Minute" freq is deprecated in v0.17.0, and recommended to use ``freq="T"`` instead (:issue:`11854`) | |||
- Bug in ``Series`` construction with ``Categorical`` and ``dtype='category'`` is specified (:issue:`12574`) | |||
|
|||
|
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.
in the future, don't take blank lines the whatsnew, just make your changes. I put these in because then we don't have conflicts with multiple PR's.
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 see. git is telling me conflicts in whatsnew and I got confused.
All checks passed, ready to merge. |
thanks @Xbar |
Added if condition for fillna when ndim==3 (for Panel) Issue: #12624