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

TypeError in SparseSeries.__repr__ when series longer than max_rows #10560

Closed
mcwitt opened this issue Jul 13, 2015 · 1 comment
Closed

TypeError in SparseSeries.__repr__ when series longer than max_rows #10560

mcwitt opened this issue Jul 13, 2015 · 1 comment
Labels
Bug Output-Formatting __repr__ of pandas objects, to_string Sparse Sparse Data Type

Comments

@mcwitt
Copy link
Contributor

mcwitt commented Jul 13, 2015

In [2]: pd.__version__
Out[2]: '0.16.2-123-gdf1f5cf'

In [3]: pd.options.display.max_rows = 3

In [4]: pd.Series(randn(3)).to_sparse()
Out[4]: 
0    1.100684
1   -0.924482
2   -0.106069
dtype: float64
BlockIndex
Block locations: array([0], dtype=int32)
Block lengths: array([3], dtype=int32)

In [5]: pd.Series(randn(4)).to_sparse()
Out[5]: ---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
...
TypeError: cannot concatenate a non-NDFrame object

Set max_rows=3 for demonstration, but occurs also for the default max_rows=60.

@jorisvandenbossche jorisvandenbossche added Output-Formatting __repr__ of pandas objects, to_string Sparse Sparse Data Type Bug labels Jul 13, 2015
@jorisvandenbossche jorisvandenbossche added this to the 0.17.0 milestone Jul 13, 2015
@kawochen kawochen mentioned this issue Jul 19, 2015
18 tasks
@jreback jreback modified the milestones: Next Major Release, 0.17.0 Aug 20, 2015
@pocman
Copy link

pocman commented Nov 16, 2015

FIX : If you just create the SparseSeries in a script without printing, it will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Output-Formatting __repr__ of pandas objects, to_string Sparse Sparse Data Type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants