pydata/pandas — pull request #8701 by jreback (2014-11-01 16:27:22+00:00)
Title: ENH: provide a null_counts keyword to df.info() to force showing of null counts

Allows run-time control of showing of null-counts with ``df.info()`` (similar to what we allow with for example memory_usage in that this will override the default options for that call)

```
In [2]: df = DataFrame(1,columns=range(10),index=range(10))

In [3]: df.iloc[1,1] = np.nan
```

Default for a small frame (currently) is to show the non-null counts
```
In [5]: df.info()

Int64Index: 10 entries, 0 to 9
Data columns (total 10 columns):
0 10 non-null float64
1 9 non-null float64
2 10 non-null float64
3 10 non-null float64
4 10 non-null float64
5 10 non-null float64
6 10 non-null float64
7 10 non-null float64
8 10 non-null float64
9 10 non-null float64
dtypes: float64(10)
memory usage: 880.0 bytes

# allow it to be turned off
In [6]: df.info(null_counts=False)

Int64Index: 10 entries, 0 to 9
Data columns (total 10 columns):
0 float64
1 float64
2 float64
3 float64
4 float64
5 float64
6 float64
7 float64
8 float64
9 float64
dtypes: float64(10)
memory usage: 880.0 bytes
```

When you have a big frame, right now you need to set max_info_rows to control this option
```
In [7]: pd.set_option('max_info_rows',5)

In [8]: df.info()

Int64Index: 10 entries, 0 to 9
Data columns (total 10 columns):
0 float64
1 float64
2 float64
3 float64
4 float64
5 float64
6 float64
7 float64
8 float64
9 float64
dtypes: float64(10)
memory usage: 880.0 bytes

# force it to show
In [9]: df.info(null_counts=True)

Int64Index: 10 entries, 0 to 9
Data columns (total 10 columns):
0 10 non-null float64
1 9 non-null float64
2 10 non-null float64
3 10 non-null float64
4 10 non-null float64
5 10 non-null float64
6 10 non-null float64
7 10 non-null float64
8 10 non-null float64
9 10 non-null float64
dtypes: float64(10)
memory usage: 880.0 bytes
```