-
- Notifications
You must be signed in to change notification settings - Fork 19.4k
Closed
Description
groupby.fillna not working along column axis.
The bug exists for 15.1 and 15.2
Works for 13.1
import pandas as pd import numpy as np print pd.__version__ test = pd.DataFrame(index=pd.MultiIndex.from_product([['value1','value2'],pd.date_range('2014-01-01','2014-01-06')]), columns=pd.Index(['1','2'], name='id')) test['1'] = [np.nan, 1, np.nan, np.nan, 11, np.nan, np.nan, 2, np.nan, np.nan, 22, np.nan] test['2'] = [np.nan, 3, np.nan, np.nan, 33, np.nan, np.nan, 4, np.nan, np.nan, 44, np.nan] testT = test.T print '*' * 30 print test print '*' * 30 print test.groupby(level=0, axis=0).fillna(method='ffill') print '*' * 30 print testT print '*' * 30 print testT.groupby(level=0, axis=1).fillna(method='ffill') print '*' * 30