Skip to content

Commit

Permalink
BUG: Override SparseDataFrame.where method to set _default_fill_value
Browse files Browse the repository at this point in the history
  • Loading branch information
Licht-T committed Sep 16, 2017
1 parent 163dee2 commit d0bf226
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pandas/core/sparse/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,15 @@ def copy(self, deep=True):
result._default_kind = self._default_kind
return result

def where(self, cond, other=np.nan, inplace=False, axis=None, level=None,
try_cast=False, raise_on_error=True):
result = super(SparseDataFrame, self).where(cond, other,
inplace, axis,
level, try_cast,
raise_on_error)
result._default_fill_value = other
return result

@property
def default_fill_value(self):
return self._default_fill_value
Expand Down

0 comments on commit d0bf226

Please sign in to comment.