Skip to content

Repr-ing SparseDataFrame after setting a value #15488

Closed
@kernc

Description

@kernc

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIndexingRelated to indexing on series/frames, not to indexes themselvesSparseSparse Data Type

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions