Skip to content

API: SparseSeries.to_frame and SparseDataFrame.to_panel result in dense structures #9850

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

Closed
sinhrks opened this issue Apr 11, 2015 · 1 comment
Labels
Milestone

Comments

@sinhrks
Copy link
Member

sinhrks commented Apr 11, 2015

Related to #9802. I think these should return sparse.

import pandas as pd

ss = pd.SparseSeries([1, 0, 1])
type(ss.to_frame())
# <class 'pandas.core.frame.DataFrame'>

index = pd.MultiIndex.from_tuples([(0, 0), (0, 1), (1, 1)])
sdf = pd.SparseDataFrame([[1, 0, 1], [0, 0, 0], [1, 0, 0]], index=index)
type(sdf.to_panel())
# <class 'pandas.core.panel.Panel'>
@sinhrks sinhrks changed the title API: SparseSeries.to_frame and SparseDataFrame.to_panel results in dense structures API: SparseSeries.to_frame and SparseDataFrame.to_panel result in dense structures Apr 11, 2015
@shoyer
Copy link
Member

shoyer commented Apr 11, 2015

Agreed. We discussed this here: #8048

@jreback jreback added Bug API Design Sparse Sparse Data Type labels Apr 11, 2015
@jreback jreback added this to the Next Major Release milestone Apr 11, 2015
@jreback jreback modified the milestones: 0.18.1, Next Major Release Apr 9, 2016
@jreback jreback closed this as completed in f813425 Apr 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants