BUG: #12624 where Panel.fillna() ignores inplace=True
State: closed

Added if condition for fillna when ndim==3 (for Panel) Issue: https://github.com/pydata/pandas/issues/12624


Labels:
name: Bug
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate

Comments:
this is duped by #12630 but your soln is nicer. Needs tests.

Added test case in test_panel.py: test_fillna
Using data provided in issue: https://github.com/pydata/pandas/issues/12624

pls add a whatsnew note as well.

Test case changes:
1. Add test case for Panel.fillna, method=‘bfill’
2. Change variable name of expected result to “expected”.
3. Fix discrepancy in dtype by forcing both Panel in this test case to have
dtype=np.float64

Style changes in generic.py:
Added "else" in fillna when ndim==3. Better readability.

some small changes. pls add a whatsnew note.

1. Updated whatsnew.
2. Style changes in generic.py. 
   -Removed return. 
   -Reduced if branches when ndim==3. 
   -One "if" for inplace at the end of the method. Do not judge inplace twice, unless method is not implemented for some special cases.

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).
`git diff master | flake8 --diff` to check/fix.

https://travis-ci.org/pydata/pandas/jobs/116251314, look at the very end

pls also rebase on master: `git rebase -i master` (this will squash as well)

Thanks for the reminder!
Sorry for making so many commits. I'm new to git and version control.

no, making lots of commits is fine (and good!).

At the end we just like to squash them to a single one.

## [Current coverage](https://codecov.io/github/pydata/pandas?ref=cb49b07e23bbc5961e6e3397a0e7765bddb83d1d) is `88.64%`

> Merging **#12633** into **master** will not affect coverage as of [`cb49b07`](https://codecov.io/github/pydata/pandas/commit/cb49b07e23bbc5961e6e3397a0e7765bddb83d1d)

``` diff
@@            master   #12633   diff @@
=======================================
  Files          275      275       
  Stmts       133688   133696     +8
  Branches         0        0       
  Methods          0        0       
=======================================
+ Hit         118511   118519     +8
  Partial          0        0       
  Missed       15177    15177       
```

> Review entire [Coverage Diff](https://codecov.io/github/pydata/pandas/compare/f71537ab2561ab5727008095e9685966619fa7b9...cb49b07e23bbc5961e6e3397a0e7765bddb83d1d) as of [`cb49b07`](https://codecov.io/github/pydata/pandas/commit/cb49b07e23bbc5961e6e3397a0e7765bddb83d1d)
> 
> Powered by [Codecov](https://codecov.io). Updated on successful CI builds.

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

`git rebase -i master`, then once squashed `git push yourremote thisbranch -f`

FYI, you don't want to `git merge master` normally, instead `git pull --rebase`. This is the workflow that we use here.

I finally got the idea here. Thanks!
Now it's just 1 commit.

ok great. ping when green.

All checks passed, ready to merge.

thanks @Xbar