API/BUG: SparseSeries.shape ignores fill_value · Issue #10452 · pandas-dev/pandas (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
SparseSeries.shape
seems to return incorrect result ignoring shapes filled by fill_value
.
s = pd.SparseSeries([0, 0, 1, 0], fill_value=0)
s
#0 0
#1 0
#2 1
#3 0
# dtype: int64
# BlockIndex
# Block locations: array([2], dtype=int32)
# Block lengths: array([1], dtype=int32)
len(s)
#4
# must be (4, )?
s.shape
# (1,)
# OK
s._data.shape
# (4,)