Skip to content

DataFrame[sparse].__getitem__ should be Series, not SparseSeries #23559

Closed
@TomAugspurger

Description

@TomAugspurger

Can we break API here to return a Series[Sparse] instead?

In [12]: df = pd.DataFrame({"A": pd.SparseArray([1, 2, 3])})

In [13]: df.dtypes
Out[13]:
A    Sparse[int64, 0]
dtype: object

In [14]: type(df['A'])
Out[14]: pandas.core.sparse.series.SparseSeries

cc @rkern

Metadata

Metadata

Assignees

No one assigned

    Labels

    SparseSparse Data Type

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions