We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c82d972 commit 1a5c3dfCopy full SHA for 1a5c3df
pandas/core/sparse/series.py
@@ -9,7 +9,6 @@
9
import warnings
10
11
from pandas.core.dtypes.missing import isna, notna
12
-from pandas.core.dtypes.common import is_sparse
13
14
from pandas.compat.numpy import function as nv
15
from pandas.core.index import Index, _ensure_index, InvalidIndexError
@@ -528,10 +527,8 @@ def to_dense(self, sparse_only=False):
528
527
index = self.index.take(int_index.indices)
529
return Series(self.sp_values, index=index, name=self.name)
530
else:
531
- values = self.values
532
- if is_sparse(values):
533
- values = values.to_dense()
534
- return Series(values, index=self.index, name=self.name)
+ return Series(self.values.to_dense(), index=self.index,
+ name=self.name)
535
536
@property
537
def density(self):
0 commit comments