-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix fillna to support partial column index for multi-index columns. (#…
…1244) Fix `fillna` to support partial column index for multi-index columns. E.g., ```py >>> import pandas as pd >>> import numpy as np >>> pdf = pd.DataFrame({('x', 'a'): [np.nan, 2, 3, 4, np.nan, 6], ... ('x', 'b'): [1, 2, np.nan, 4, np.nan, np.nan], ... ('y', 'c'): [1, 2, 3, 4, np.nan, np.nan]}) >>> pdf x y a b c 0 NaN 1.0 1.0 1 2.0 2.0 2.0 2 3.0 NaN 3.0 3 4.0 4.0 4.0 4 NaN NaN NaN 5 6.0 NaN NaN >>> pdf.fillna({'x': -1}) x y a b c 0 -1.0 1.0 1.0 1 2.0 2.0 2.0 2 3.0 -1.0 3.0 3 4.0 4.0 4.0 4 -1.0 -1.0 NaN 5 6.0 -1.0 NaN ```
- Loading branch information
Showing
2 changed files
with
30 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters