Skip to content

Commit 1c0613b

Browse files
committed
BUG: Override SparseDataFrame.where method to set _default_fill_value
1 parent 2803662 commit 1c0613b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pandas/core/sparse/frame.py

+9
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,15 @@ def copy(self, deep=True):
334334
result._default_kind = self._default_kind
335335
return result
336336

337+
def where(self, cond, other=np.nan, inplace=False, axis=None, level=None,
338+
try_cast=False, raise_on_error=True):
339+
result = super(SparseDataFrame, self).where(cond, other,
340+
inplace, axis,
341+
level, try_cast,
342+
raise_on_error)
343+
result._default_fill_value = other
344+
return result
345+
337346
@property
338347
def default_fill_value(self):
339348
return self._default_fill_value

0 commit comments

Comments
 (0)