Skip to content

Commit

Permalink
BUG: Drop faulty and redundant reindex() for SparseSeries
Browse files Browse the repository at this point in the history
  • Loading branch information
toobaz committed Mar 3, 2017
1 parent d80275d commit 55b99f8
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions pandas/sparse/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,7 @@ def copy(self, deep=True):
return self._constructor(new_data, sparse_index=self.sp_index,
fill_value=self.fill_value).__finalize__(self)

def reindex(self, index=None, method=None, copy=True, limit=None,
**kwargs):
def reindex(self, index=None, **kwargs):
"""
Conform SparseSeries to new Index
Expand All @@ -581,16 +580,7 @@ def reindex(self, index=None, method=None, copy=True, limit=None,
-------
reindexed : SparseSeries
"""
new_index = _ensure_index(index)

if self.index.equals(new_index):
if copy:
return self.copy()
else:
return self
return self._constructor(self._data.reindex(new_index, method=method,
limit=limit, copy=copy),
index=new_index).__finalize__(self)
return super(SparseSeries, self).reindex(index, **kwargs)

def sparse_reindex(self, new_index):
"""
Expand Down

0 comments on commit 55b99f8

Please sign in to comment.