Closed
Description
Specifying inplace
returns an empty frame or a Series with all None
values, and neither modifies the original input. Instead of fixing this, I think we should deprecate the inplace
argument of these methods.
df = pd.DataFrame({'a': [1, 1, 2], 'b': [np.nan, 3, np.nan]})
gb = df.groupby('a')
print(gb.fillna(0, inplace=True))
# Empty DataFrame
# Columns: []
# Index: []
print(gb['b'].fillna(0, inplace=True))
# a
# 1 None
# 2 None
# Name: b, dtype: object
print(df)
# a b
# 0 1 NaN
# 1 1 3.0
# 2 2 NaN