Skip to content

BUG: Sparse structures don't fully support value assignment #21818

Open
@kernc

Description

@kernc

Code Sample, a copy-pastable example if possible

>>> ss = pd.SparseSeries([1, 2])
>>> ss.iloc[0] = 3

-----------------------------------------------------------------------
TypeError: SparseArray does not support item assignment via setitem

Problem description

SparseSeries and SparseDataFrame don't support value assignment through some indexers (but might from others, i.e. ss[0] = 4 works).

Expected Output

Assignment works in all cases.

Output of pd.show_versions()

pandas 0.24.dev 5cb5880

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions