Open greglandrum opened 6 years ago
I actually cannot reproduce this on master
(I get the same output as you describe for v0.22.0
).
Perhaps we can add a test for this in the repository and close this out?
Can you reproduce it with v0.23.0?
hmm, I just tried on my Windows machine and it doesn't happen there in a bash shell, but does when I run it in whatever the "Anaconda Prompt" uses.
I have observed the problem under both Ubuntu 18.04 and Centos 6 on the linux side.
hmm, I just tried on my Windows machine and it doesn't happen there. I have observed the problem under both Ubuntu 18.04 and Centos 6 on the linux side.
@greglandrum : Same type of deal here.
@greglandrum True that, used Windows machine and could not reproduce the same.
Code:
and I am using Linux now yet I cannot reproduce the same..any other method that you could suggest to triage the same?
This is due to the change of the default of pandas.options.display.max_columns
of 20 to 0.
If you set this manually to 20, it should fix your problem. Although we should still find a solution as not printing any data is a bit strange ..
Confirmed that setting pandas.options.display.max_columns
to 20 fixes the problem for me. Thanks!
I understand setting the default to 0
so that things work nicely by default in the terminal or when using IPython, but it doesn't seem correct that the logic to auto-detect the terminal width that max_columns=-
triggers overrides the value of pandas.options.display.width
that I set.
If you would only have used pd.set_option('display.max_colwidth', 10000)
, I think we can say it is up to the responsibility of the user to also change the max_columns
option appropriately (it is difficult to have a good default that also works well in combination with every other possible setting).
But by also setting display.width
, I would expect that it should honour that, as you say.
Welcome to look into it!
So the 'bug' is that with pd.options.display.max_columns = 0
it does not follow the specified pd.options.display.width
In [8]: df = pd.DataFrame(np.random.randn(5,10))
In [9]: df <----- default repr
Out[9]:
0 1 2 3 ... 6 7 8 9
0 -0.114989 -1.313691 -1.012763 1.210505 ... 1.741739 -0.293015 -0.518975 -0.046243
1 -1.001067 -0.896490 -0.106518 0.080232 ... -0.845052 0.272609 -0.983768 0.963105
2 0.665218 -0.318560 -1.127493 -2.073078 ... -0.421405 1.653298 0.989827 1.392743
3 -1.298340 -0.441758 1.551385 -1.389610 ... 1.113139 0.970295 -2.177596 -0.909323
4 0.206135 0.292685 1.570472 -0.065448 ... 0.780934 1.921372 0.256083 -0.499103
[5 rows x 10 columns]
In [10]: pd.options.display.width = 40
In [11]: df <----- not honouring the width
Out[11]:
0 1 2 3 ... 6 7 8 9
0 -0.114989 -1.313691 -1.012763 1.210505 ... 1.741739 -0.293015 -0.518975 -0.046243
1 -1.001067 -0.896490 -0.106518 0.080232 ... -0.845052 0.272609 -0.983768 0.963105
2 0.665218 -0.318560 -1.127493 -2.073078 ... -0.421405 1.653298 0.989827 1.392743
3 -1.298340 -0.441758 1.551385 -1.389610 ... 1.113139 0.970295 -2.177596 -0.909323
4 0.206135 0.292685 1.570472 -0.065448 ... 0.780934 1.921372 0.256083 -0.499103
[5 rows x 10 columns]
In [12]: pd.options.display.max_columns = 20
In [13]: df <----- now it does follow the width
Out[13]:
0 1 2 \
0 -0.114989 -1.313691 -1.012763
1 -1.001067 -0.896490 -0.106518
2 0.665218 -0.318560 -1.127493
3 -1.298340 -0.441758 1.551385
4 0.206135 0.292685 1.570472
3 4 5 \
0 1.210505 0.490016 0.990289
1 0.080232 -0.490654 0.256616
2 -2.073078 0.558430 -0.324658
3 -1.389610 0.745468 0.544909
4 -0.065448 -0.682855 0.377820
...
cc @cbrnr
@jorisvandenbossche : I think we just need to test this on master
, since I was unable to reproduce with master
on both Windows and Linux.
I can reproduce this on master (and I also would not know what would have changed this since 0.23.0)
I can reproduce this on master (and I also would not know what would have changed this since 0.23.0)
Huh...that's odd. I wonder if it's OS-specific? I just used Windows 10 and Ubuntu 14.04.
Marking as regression
then.
Did you make sure to use a "small" terminal? (otherwise you don't have the problem)
Did you make sure to use a "small" terminal? (otherwise you don't have the problem)
@jorisvandenbossche : Evidently not small enough 😄
note if someone really wants to block on this, pls move back to 0.23.1, but unless there is an active PR (or you really really want to delay things), pls dont
More data points: @gfyoung It could be system specific. I ran into this problem while testing an application locally on macos 10.13.6 (where a four column dataframe was correctly displaying all columns) and in a kubernetes pod in Ubuntu 16.04 (where it only displayed 3 of 4 columns). The code was identical for both, setting max_columns=5 and width=120. (pandas 0.23.3)
Code Sample, a copy-pastable example if possible
Problem description
Here's the output with v0.23:
I believe that, since I am setting
display.width
anddispaly.max_colwidth
I should not be seeing ellipsis under any circumstances (I did not with v0.22, see below).Additionally: it doesn't seem like the column order should make any difference.
Expected Output
Here's what I get with Pandas v0.22:
Output of
pd.show_versions()