You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From dask/dask#1063. fill_value doesn't seem to apply if the argument to a binary operator is a constant, but works fine for other arguments:
In [1]: importpandasaspdIn [2]: df=pd.DataFrame(range(10), columns=['foo'])
In [3]: df2=df.copy()
In [4]: df2.iloc[0] =NoneIn [5]: df2.add(2, fill_value=0)
Out[5]:
foo0NaN13.024.035.046.057.068.079.0810.0911.0In [6]: df2.add(df, fill_value=0)
Out[6]:
foo00.012.024.036.048.0510.0612.0714.0816.0918.0In [7]: pd.__version__Out[7]: u'0.18.0rc2+2.g19e40a0'
From the docstring I'd expect it to be equivalent to df2.fillna(0).add(2). If this is intended behavior, then the docstring should be updated to clarify this.
The text was updated successfully, but these errors were encountered:
The fix is not complete, I find that the unexpected behavior exists also in Series.
sinhrks
changed the title
Unexpected behavior with behavior with binary operators and fill_value
Unexpected behavior with binary operators and fill_value
Apr 4, 2016
From dask/dask#1063.
fill_value
doesn't seem to apply if the argument to a binary operator is a constant, but works fine for other arguments:From the docstring I'd expect it to be equivalent to
df2.fillna(0).add(2)
. If this is intended behavior, then the docstring should be updated to clarify this.The text was updated successfully, but these errors were encountered: