Skip to content

API: sparse.cumsum should default to stats axis #13048

Closed
@jreback

Description

@jreback

xref #12810

In [1]: sp = pd.SparseDataFrame([1, 2, 3])

In [2]: np.cumsum(sp)
ValueError: No axis named None for object type <class 'pandas.sparse.frame.SparseDataFrame'>

In [3]: np.cumsum(sp, axis=0)
Out[3]: 
     0
0  1.0
1  3.0
2  6.0

In [4]: np.cumsum(sp, axis=1)
Out[4]: 
     0
0  1.0
1  2.0
2  3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Compatpandas objects compatability with Numpy or Python functionsSparseSparse Data Type

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions