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

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

Closed
sinhrks opened this Issue Apr 11, 2015 · 1 comment

Comments

Projects
None yet
3 participants
@sinhrks
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 from API: SparseSeries.to_frame and SparseDataFrame.to_panel results in dense structures to API: SparseSeries.to_frame and SparseDataFrame.to_panel result in dense structures Apr 11, 2015

@shoyer

This comment has been minimized.

Show comment
Hide comment
@shoyer

shoyer Apr 11, 2015

Member

Agreed. We discussed this here: #8048

Member

shoyer commented Apr 11, 2015

Agreed. We discussed this here: #8048

@jreback jreback added this to the Next Major Release milestone Apr 11, 2015

@sinhrks sinhrks referenced this issue Apr 9, 2016

Closed

BUG: SparseSeries.to_frame results in dense #12836

4 of 4 tasks complete

@jreback jreback modified the milestones: 0.18.1, Next Major Release Apr 9, 2016

@jreback jreback closed this in f813425 Apr 9, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment