Skip to content

API/BUG: SparseSeries.shape ignores fill_value  #10452

Closed
@sinhrks

Description

@sinhrks

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,)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions