<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Dec 8, 2017 at 8:54 AM, Joris Van den Bossche <span dir="ltr"><<a href="mailto:jorisvandenbossche@gmail.com" target="_blank">jorisvandenbossche@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><font size="2"><i>[Note for those reading it on the pydata mailing list, please answer to <a href="mailto:pandas-dev@python.org" target="_blank">pandas-dev@python.org</a> to keep discussion centralised there]</i><br></font></div><div><br></div><div>Hi all,</div><div><br></div><div>I am reposting the mail of Clemens below, but with slightly changed focus, as I think the main discussion point is about the number of rows.</div><div><br></div><div>The proposal in <a href="https://github.com/pandas-dev/pandas/pull/17023" rel="noreferrer" target="_blank">https://github.com/pandas-dev/<wbr>pandas/pull/17023</a> is to lower the default number of rows shown when displaying a Series or DataFrame from 60 to 20.</div></div><div>Thoughts on that?<br></div></div></div></blockquote><div><br><br><div>Personally, I always set the max rows to 10 or 20, so I'd be OK with it if the community is on board.<br><br></div>Tom<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div></div>Best,<br></div>Joris<br><br><div><div><div> </div></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div class="gmail_extra"><div class="gmail_quote">2017-11-28 11:57 GMT+01:00 Clemens Brunner <span dir="ltr"><<a href="mailto:clemens.brunner@gmail.com" target="_blank">clemens.brunner@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello!<br>
<br>
We're currently discussing a change in how data frames are displayed by default in <a href="https://github.com/pandas-dev/pandas/pull/17023" rel="noreferrer" target="_blank">https://github.com/pandas-dev/<wbr>pandas/pull/17023</a>. There are two proposed changes:<br>
<br>
(1) Set pd.options.display.max_columns<wbr>=0 (previously this was set to 20).<br>
(2) Set pd.options.display.max_rows=20 (previously this was set to 60).<br>
<br>
Change (1) means that the number of printed columns is adapted to fit within the width of the terminal. If there are too many columns, ellipsis will be shown to indicate collapsed columns in the middle of the data frame. This doesn't work if Python is run as a Jupyter kernel (e.g. in a Jupyter notebook or in IPython QtConsole), in which case the maximum columns remain 20.<br>
<br>
Example:<br>
========<br>
import pandas as pd<br>
import numpy as np<br>
pd.DataFrame(np.random.rand(5, 10))<br>
<br>
Output before (in a terminal with 100 chars width):<br>
------------------------------<wbr>---------------------<br>
          0         1         2         3         4         5         6  \<br>
0  0.643979  0.690414  0.018603  0.991478  0.707534  0.376765  0.670848<br>
1  0.547836  0.810972  0.054448  0.415112  0.268120  0.904528  0.839258<br>
2  0.582256  0.732149  0.284208  0.405197  0.213591  0.715367  0.150106<br>
3  0.197348  0.317159  0.051669  0.738405  0.821046  0.179270  0.245793<br>
4  0.483466  0.583330  0.999213  0.882883  0.315169  0.045712  0.897048<br>
<br>
          7         8         9<br>
0  0.891467  0.494220  0.713369<br>
1  0.601304  0.449880  0.266205<br>
2  0.113262  0.360580  0.238833<br>
3  0.798063  0.077769  0.471169<br>
4  0.262779  0.530565  0.992084<br>
<br>
Output after:<br>
-------------<br>
          0         1         2         3    ...            6         7         8         9<br>
0  0.673621  0.211505  0.943201  0.946548    ...     0.900453  0.612182  0.861933  0.710967<br>
1  0.670855  0.834449  0.796273  0.785976    ...     0.609954  0.686663  0.684582  0.837505<br>
2  0.544736  0.814827  0.352893  0.459556    ...     0.650993  0.735943  0.279110  0.840203<br>
3  0.440125  0.554323  0.745462  0.940896    ...     0.544576  0.224175  0.852603  0.509837<br>
4  0.225551  0.791834  0.476059  0.321857    ...     0.391165  0.423213  0.290683  0.954423<br>
<br>
[5 rows x 10 columns]<br>
<br>
<br>
Change (2) implies fewer rows are displayed before auto-hiding takes place. I find that 60 rows almost always causes the terminal to scroll (most terminals have between 25-40 rows), so reducing the value to 20 increases the chance that a data frame can be observed on one terminal page. I'm not including a before/after output since it should be easy to imagine how this change affects the output.<br>
<br>
Both changes would make Pandas behave similar to R's Tidyverse (which I really like), but this should not be the main reason why these changes are a good idea. I mainly like them because these settings make (large) data frames much nicer to look at.<br>
<br>
Note that these changes affect the default values. Of course, users are free to change them back in their active Python session.<br>
<br>
Comments to both proposed changes are highly welcome (either here on the mailing list or at <a href="https://github.com/pandas-dev/pandas/pull/17023" rel="noreferrer" target="_blank">https://github.com/pandas-dev/<wbr>pandas/pull/17023</a>.<br>
<br>
Clemens<br>
______________________________<wbr>_________________<br>
Pandas-dev mailing list<br>
<a href="mailto:Pandas-dev@python.org" target="_blank">Pandas-dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/pandas-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/pandas-dev</a><span class="gmail-HOEnZb"><font color="#888888"><br>
</font></span></blockquote></div><span class="gmail-HOEnZb"><font color="#888888"><br></font></span></div></div></div></div><span class="gmail-HOEnZb"><font color="#888888">

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups "PyData" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:pydata+unsubscribe@googlegroups.com" target="_blank">pydata+unsubscribe@<wbr>googlegroups.com</a>.<br>
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank">https://groups.google.com/d/<wbr>optout</a>.<br>
</font></span></blockquote></div><br></div></div>