Skip to content

BUG: Series not correctly formatted in truncated output #8532

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
3 tasks
jorisvandenbossche opened this issue Oct 10, 2014 · 5 comments · Fixed by #9182
Closed
3 tasks

BUG: Series not correctly formatted in truncated output #8532

jorisvandenbossche opened this issue Oct 10, 2014 · 5 comments · Fixed by #9182
Labels
Bug Output-Formatting __repr__ of pandas objects, to_string
Milestone

Comments

@jorisvandenbossche
Copy link
Member

Overview of the issues:


When a Series gets truncated, it seems that both parts are formatted separately, with the consequence that eg:

  • the float formatting can be different in both parts
  • the alignment (depending on the width of the index) is different in both parts

Note that this is not the case with a DataFrame

In [44]: s = pd.Series([1,1,1,1,1,1,1,1,1,1,0.9999,1,1]*10)

In [45]: pd.options.display.max_rows = 10

In [46]: s
Out[46]:
0    1
1    1
2    1
...
127    0.9999
128    1.0000
129    1.0000
Length: 130, dtype: float64

In [47]: s.to_frame()
Out[47]:
          0
0    1.0000
1    1.0000
2    1.0000
3    1.0000
4    1.0000
..      ...
125  1.0000
126  1.0000
127  0.9999
128  1.0000
129  1.0000

[130 rows x 1 columns]
@jorisvandenbossche jorisvandenbossche added Bug Output-Formatting __repr__ of pandas objects, to_string labels Oct 10, 2014
@jorisvandenbossche
Copy link
Member Author

@bjonen if you would be interested

related #7508 about incorrect number of elements in truncated view (which you can also see in the example above)

@jreback
Copy link
Contributor

jreback commented Nov 24, 2014

cc @bjonen can you tackle?

@jreback jreback modified the milestones: 0.16.0, 0.15.2 Nov 24, 2014
@bjonen
Copy link
Contributor

bjonen commented Nov 25, 2014

I won't have time for the next two weeks. After that I'm happy to take a look.

@bjonen
Copy link
Contributor

bjonen commented Dec 23, 2014

@jreback Is this the main priority right now?

@jreback
Copy link
Contributor

jreback commented Dec 23, 2014

@bjonen this would be nice to fix! thanks

@jreback jreback modified the milestones: 0.16.0, Next Major Release Mar 6, 2015
@jorisvandenbossche jorisvandenbossche modified the milestones: 0.16.0, Next Major Release Mar 16, 2015
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants