BUG: regression in max_info_columns behaviour? · Issue #6939 · pandas-dev/pandas (original) (raw)

Update:


When you have more columns than specified in max_info_columns, df.info() will now still show all columns, but just without the information about the number of null values:

In [1]: pd.__version__
Out[1]: '0.13.1-656-gf30278e'

In [4]: df.info()
<class 'pandas.core.frame.DataFrame'>
Int64Index: 5 entries, 0 to 4
Data columns (total 5 columns):
0    5 non-null float64
1    5 non-null float64
2    5 non-null float64
3    5 non-null float64
4    5 non-null float64
dtypes: float64(5)

In [5]: df.info(verbose=False)
<class 'pandas.core.frame.DataFrame'>
Int64Index: 5 entries, 0 to 4
Columns: 5 entries, 0 to 4
dtypes: float64(5)

In [6]: pd.options.display.max_info_columns = 4

In [7]: df.info()
<class 'pandas.core.frame.DataFrame'>
Int64Index: 5 entries, 0 to 4
Data columns (total 5 columns):
0    float64
1    float64
2    float64
3    float64
4    float64
dtypes: float64(5)

while previously in 0.13 this gave the same behaviour as for info(verbose=False):

In [15]: pd.__version__
Out[15]: '0.13.0'

In [16]: pd.options.display.max_info_columns = 4

In [17]: df.info()
<class 'pandas.core.frame.DataFrame'>
Int64Index: 5 entries, 0 to 4
Columns: 5 entries, 0 to 4
dtypes: float64(5)

which seems much more logical to me.

I suppose this is related to #5682, which added the behaviour to also show the dtype per column.

Update: it was deliberately added in #5974