Skip to content

BUG: inconsistent constructors for sparse and dense objects #9272

Closed
@wholmgren

Description

@wholmgren

Continuing on my recent sparse kick...

I appreciate the fact that Series(), DataFrame(), and Panel() all return empty versions of themselves. I think it's reasonable to expect that their sparse counterparts would behave the same way, but this is only the case for SparseDataFrame() (it's even tested).

pd.SparseSeries()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-375-46c1881ac0a7> in <module>()
----> 1 pd.SparseSeries()

TypeError: __init__() missing 1 required positional argument: 'data'

and similar for SparsePanel().

I can submit a PR to change this behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions