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

Set pd.options.display.max_rows = 20 by default #20514

Closed
wants to merge 2 commits into from
Closed

Set pd.options.display.max_rows = 20 by default #20514

wants to merge 2 commits into from

Conversation

cbrnr
Copy link
Contributor

@cbrnr cbrnr commented Mar 28, 2018

As a follow-up to #17023, I propose to change the default number of displayed rows to 20.

  • closes #xxxx
  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

@jreback jreback added the Output-Formatting __repr__ of pandas objects, to_string label Mar 28, 2018
@jreback
Copy link
Contributor

jreback commented Mar 28, 2018

can you add a whatsnew section about this

@codecov
Copy link

codecov bot commented Mar 28, 2018

Codecov Report

Merging #20514 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #20514      +/-   ##
==========================================
+ Coverage   91.81%   91.84%   +0.02%     
==========================================
  Files         152      152              
  Lines       49261    49259       -2     
==========================================
+ Hits        45231    45241      +10     
+ Misses       4030     4018      -12
Flag Coverage Δ
#multiple 90.23% <100%> (+0.02%) ⬆️
#single 41.92% <100%> (+0.02%) ⬆️
Impacted Files Coverage Δ
pandas/core/config_init.py 99.24% <100%> (ø) ⬆️
pandas/core/nanops.py 96.3% <0%> (-0.4%) ⬇️
pandas/util/_decorators.py 82.25% <0%> (-0.15%) ⬇️
pandas/core/generic.py 95.85% <0%> (ø) ⬆️
pandas/core/strings.py 98.32% <0%> (ø) ⬆️
pandas/core/series.py 93.85% <0%> (ø) ⬆️
pandas/util/testing.py 84.73% <0%> (+0.2%) ⬆️
pandas/plotting/_converter.py 66.81% <0%> (+1.73%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c9e8f59...06d6df1. Read the comment docs.

@cbrnr
Copy link
Contributor Author

cbrnr commented Mar 29, 2018

Done.

@jorisvandenbossche
Copy link
Member

See the mail I sent about this on the mailing list: https://mail.python.org/pipermail/pandas-dev/2018-March/000732.html

@cbrnr
Copy link
Contributor Author

cbrnr commented Mar 29, 2018

Did you get any replies?

I like the idea of two thresholds, but the main idea behind reducing the number of displayed rows is to avoid having to scroll. R (tibble) sets these thresholds to 20 (show all rows up to) and 10 (truncated repr), which always result in reprs that fit within the typical terminal height.

However, RStudio has a View function, which opens the full dataframe in a spreadsheet-like view. Pandas doesn't have this, so I understand if people want to see more rows by default. If there were a way to show the desired number of rows somehow - e.g. a new method similar to head that doesn't return a dataframe, but just prints out the specified number of rows?

@jorisvandenbossche
Copy link
Member

Sorry for the late reply. I understand the reason of wanting to fit the output on the screen, but the balance with being able to actually see data is a difficult one.
What you mention about the RStudio View, in principle this would be possible in eg the notebook (not terminal). There are already nice projects like qgrid.

Would you be interested in implementing the "two thresholds" approach?

@cbrnr
Copy link
Contributor Author

cbrnr commented Apr 27, 2018

I agree that there is no one size fits all solution. I'm not sure the two thresholds approach is a real improvement over the current situation. I think all of these settings related to personal preferences would be solved if Pandas had a configuration file that is read during import, so I'd rather help in getting #4907 done.

@jreback
Copy link
Contributor

jreback commented Nov 21, 2018

@jorisvandenbossche what is the status of this?

@datapythonista
Copy link
Member

Based on @jorisvandenbossche comments I understand we're not merging this PR, and we'll have a more complex solution. Closing, feel free to reopen if this is not the case.

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

Successfully merging this pull request may close these issues.

4 participants