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

Concat does not work for sparse series #10536

Closed
artemyk opened this issue Jul 9, 2015 · 1 comment
Closed

Concat does not work for sparse series #10536

artemyk opened this issue Jul 9, 2015 · 1 comment
Labels
Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode Sparse Sparse Data Type
Milestone

Comments

@artemyk
Copy link
Contributor

artemyk commented Jul 9, 2015

Concatenating two sparse series does not return sparse data structures as expected:

In [1]: import pandas as pd

In [2]: ts = pd.Series([0, 1, 1, 2, 3, 0 ,0 ,0])

In [3]: sts = ts.to_sparse()

In [4]: print type(pd.concat([sts, sts], axis=0))
<class 'pandas.core.series.Series'>

In [5]: print type(pd.concat([sts, sts], axis=1))
<class 'pandas.core.frame.DataFrame'>

The above does work correctly for SparseDataFrames.

@artemyk artemyk changed the title concat does not work for sparse series Concat does not work for sparse series Jul 9, 2015
@jreback jreback added Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode Sparse Sparse Data Type labels Jul 11, 2015
@jreback jreback added this to the Next Major Release milestone Jul 11, 2015
@jreback
Copy link
Contributor

jreback commented Jul 11, 2015

xref #10531

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode Sparse Sparse Data Type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants