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

Repr-ing SparseDataFrame after setting a value #15488

Closed
kernc opened this issue Feb 23, 2017 · 1 comment
Closed

Repr-ing SparseDataFrame after setting a value #15488

kernc opened this issue Feb 23, 2017 · 1 comment
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves Sparse Sparse Data Type
Milestone

Comments

@kernc
Copy link
Contributor

kernc commented Feb 23, 2017

Code Sample, a copy-pastable example if possible

>>> sdf = pd.SparseDataFrame(index=[0, 1], columns=[0, 1])
>>> sdf[0][0] = 1  # This warns; ignore
>>> sdf
AttributeError: 'NoneType' object has no attribute 'type'

Problem description

After some value is set on a copy of a SparseSeries, the enclosing SparseDataFrame can no longer be printed (raises AttributeError).

Expected Output

>>> sdf
    0   1
0 NaN NaN
1 NaN NaN

Output of pd.show_versions()

0.19.0+479.git

@jreback
Copy link
Contributor

jreback commented Feb 23, 2017

These are not implemented, so not sure that

In [3]: sdf.loc[0,0] = 1
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)

this should even work

@jreback jreback added Indexing Related to indexing on series/frames, not to indexes themselves Sparse Sparse Data Type labels Feb 23, 2017
@jreback jreback added this to the 0.20.0 milestone Feb 24, 2017
@jreback jreback added the Bug label Feb 24, 2017
@jreback jreback closed this as completed in 38a34be Mar 7, 2017
AnkurDedania pushed a commit to AnkurDedania/pandas that referenced this issue Mar 21, 2017
closes pandas-dev#15488

Author: Kernc <kerncece@gmail.com>

Closes pandas-dev#15489 from kernc/sdf-repr and squashes the following commits:

2dc145c [Kernc] BUG: repr SparseDataFrame after setting a value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves Sparse Sparse Data Type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants