Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kernc opened this issue Jul 8, 2018 · 1 comment
Open

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

kernc opened this issue Jul 8, 2018 · 1 comment
Labels
Bug Sparse Sparse Data Type

Comments

@kernc
Copy link
Contributor

kernc commented Jul 8, 2018

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

@jorisvandenbossche
Copy link
Member

The same is true for Series[sparse]:

In [44]: ss = pd.Series(pd.SparseArray([1, 2])) 
    ...: ss.iloc[0] = 3  
...
TypeError: SparseArray does not support item assignment via setitem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Sparse Sparse Data Type
Projects
None yet
Development

No branches or pull requests

3 participants