def info(self, verbose=None, buf=None, max_cols=None, memory_usage=None,<EOL>null_counts=None):
if buf is None:  <EOL><INDENT>buf = sys.stdout<EOL><DEDENT>lines = []<EOL>lines.append(str(type(self)))<EOL>lines.append(self.index._summary())<EOL>if len(self.columns) == <NUM_LIT:0>:<EOL><INDENT>lines.append('<STR_LIT>'.format(name=type(self).__name__))<EOL>fmt.buffer_put_lines(buf, lines)<EOL>return<EOL><DEDENT>cols = self.columns<EOL>if max_cols is None:<EOL><INDENT>max_cols = get_option('<STR_LIT>',<EOL>len(self.columns) + <NUM_LIT:1>)<EOL><DEDENT>max_rows = get_option('<STR_LIT>', len(self) + <NUM_LIT:1>)<EOL>if null_counts is None:<EOL><INDENT>show_counts = ((len(self.columns) <= max_cols) and<EOL>(len(self) < max_rows))<EOL><DEDENT>else:<EOL><INDENT>show_counts = null_counts<EOL><DEDENT>exceeds_info_cols = len(self.columns) > max_cols<EOL>def _verbose_repr():<EOL><INDENT>lines.append('<STR_LIT>' %<EOL>len(self.columns))<EOL>space = max(len(pprint_thing(k)) for k in self.columns) + <NUM_LIT:4><EOL>counts = None<EOL>tmpl = "<STR_LIT>"<EOL>if show_counts:<EOL><INDENT>counts = self.count()<EOL>if len(cols) != len(counts):  <EOL><INDENT>raise AssertionError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(<EOL>cols=len(cols), counts=len(counts)))<EOL><DEDENT>tmpl = "<STR_LIT>"<EOL><DEDENT>dtypes = self.dtypes<EOL>for i, col in enumerate(self.columns):<EOL><INDENT>dtype = dtypes.iloc[i]<EOL>col = pprint_thing(col)<EOL>count = "<STR_LIT>"<EOL>if show_counts:<EOL><INDENT>count = counts.iloc[i]<EOL><DEDENT>lines.append(_put_str(col, space) + tmpl.format(count=count,<EOL>dtype=dtype))<EOL><DEDENT><DEDENT>def _non_verbose_repr():<EOL><INDENT>lines.append(self.columns._summary(name='<STR_LIT>'))<EOL><DEDENT>def _sizeof_fmt(num, size_qualifier):<EOL><INDENT>for x in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>if num < <NUM_LIT>:<EOL><INDENT>return ("<STR_LIT>"<EOL>"<STR_LIT>".format(num=num, size_q=size_qualifier, x=x))<EOL><DEDENT>num /= <NUM_LIT><EOL><DEDENT>return "<STR_LIT>".format(num=num,<EOL>size_q=size_qualifier,<EOL>pb='<STR_LIT>')<EOL><DEDENT>if verbose:<EOL><INDENT>_verbose_repr()<EOL><DEDENT>elif verbose is False:  <EOL><INDENT>_non_verbose_repr()<EOL><DEDENT>else:<EOL><INDENT>if exceeds_info_cols:<EOL><INDENT>_non_verbose_repr()<EOL><DEDENT>else:<EOL><INDENT>_verbose_repr()<EOL><DEDENT><DEDENT>counts = self.get_dtype_counts()<EOL>dtypes = ['<STR_LIT>'.format(k=k[<NUM_LIT:0>], kk=k[<NUM_LIT:1>]) for k<EOL>in sorted(counts.items())]<EOL>lines.append('<STR_LIT>'.format(types='<STR_LIT:U+002CU+0020>'.join(dtypes)))<EOL>if memory_usage is None:<EOL><INDENT>memory_usage = get_option('<STR_LIT>')<EOL><DEDENT>if memory_usage:<EOL><INDENT>size_qualifier = '<STR_LIT>'<EOL>if memory_usage == '<STR_LIT>':<EOL><INDENT>deep = True<EOL><DEDENT>else:<EOL><INDENT>deep = False<EOL>if ('<STR_LIT:object>' in counts or<EOL>self.index._is_memory_usage_qualified()):<EOL><INDENT>size_qualifier = '<STR_LIT:+>'<EOL><DEDENT><DEDENT>mem_usage = self.memory_usage(index=True, deep=deep).sum()<EOL>lines.append("<STR_LIT>".format(<EOL>mem=_sizeof_fmt(mem_usage, size_qualifier)))<EOL><DEDENT>fmt.buffer_put_lines(buf, lines)<EOL>
Print a concise summary of a DataFrame.

This method prints information about a DataFrame including
the index dtype and column dtypes, non-null values and memory usage.

Parameters
----------
verbose : bool, optional
    Whether to print the full summary. By default, the setting in
    ``pandas.options.display.max_info_columns`` is followed.
buf : writable buffer, defaults to sys.stdout
    Where to send the output. By default, the output is printed to
    sys.stdout. Pass a writable buffer if you need to further process
    the output.
max_cols : int, optional
    When to switch from the verbose to the truncated output. If the
    DataFrame has more than `max_cols` columns, the truncated output
    is used. By default, the setting in
    ``pandas.options.display.max_info_columns`` is used.
memory_usage : bool, str, optional
    Specifies whether total memory usage of the DataFrame
    elements (including the index) should be displayed. By default,
    this follows the ``pandas.options.display.memory_usage`` setting.

    True always show memory usage. False never shows memory usage.
    A value of 'deep' is equivalent to "True with deep introspection".
    Memory usage is shown in human-readable units (base-2
    representation). Without deep introspection a memory estimation is
    made based in column dtype and number of rows assuming values
    consume the same memory amount for corresponding dtypes. With deep
    memory introspection, a real memory usage calculation is performed
    at the cost of computational resources.
null_counts : bool, optional
    Whether to show the non-null counts. By default, this is shown
    only if the frame is smaller than
    ``pandas.options.display.max_info_rows`` and
    ``pandas.options.display.max_info_columns``. A value of True always
    shows the counts, and False never shows the counts.

Returns
-------
None
    This method prints a summary of a DataFrame and returns None.

See Also
--------
DataFrame.describe: Generate descriptive statistics of DataFrame
    columns.
DataFrame.memory_usage: Memory usage of DataFrame columns.

Examples
--------
>>> int_values = [1, 2, 3, 4, 5]
>>> text_values = ['alpha', 'beta', 'gamma', 'delta', 'epsilon']
>>> float_values = [0.0, 0.25, 0.5, 0.75, 1.0]
>>> df = pd.DataFrame({"int_col": int_values, "text_col": text_values,
...                   "float_col": float_values})
>>> df
   int_col text_col  float_col
0        1    alpha       0.00
1        2     beta       0.25
2        3    gamma       0.50
3        4    delta       0.75
4        5  epsilon       1.00

Prints information of all columns:

>>> df.info(verbose=True)
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 5 entries, 0 to 4
Data columns (total 3 columns):
int_col      5 non-null int64
text_col     5 non-null object
float_col    5 non-null float64
dtypes: float64(1), int64(1), object(1)
memory usage: 200.0+ bytes

Prints a summary of columns count and its dtypes but not per column
information:

>>> df.info(verbose=False)
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 5 entries, 0 to 4
Columns: 3 entries, int_col to float_col
dtypes: float64(1), int64(1), object(1)
memory usage: 200.0+ bytes

Pipe output of DataFrame.info to buffer instead of sys.stdout, get
buffer content and writes to a text file:

>>> import io
>>> buffer = io.StringIO()
>>> df.info(buf=buffer)
>>> s = buffer.getvalue()
>>> with open("df_info.txt", "w",
...           encoding="utf-8") as f:  # doctest: +SKIP
...     f.write(s)
260

The `memory_usage` parameter allows deep introspection mode, specially
useful for big DataFrames and fine-tune memory optimization:

>>> random_strings_array = np.random.choice(['a', 'b', 'c'], 10 ** 6)
>>> df = pd.DataFrame({
...     'column_1': np.random.choice(['a', 'b', 'c'], 10 ** 6),
...     'column_2': np.random.choice(['a', 'b', 'c'], 10 ** 6),
...     'column_3': np.random.choice(['a', 'b', 'c'], 10 ** 6)
... })
>>> df.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 1000000 entries, 0 to 999999
Data columns (total 3 columns):
column_1    1000000 non-null object
column_2    1000000 non-null object
column_3    1000000 non-null object
dtypes: object(3)
memory usage: 22.9+ MB

>>> df.info(memory_usage='deep')
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 1000000 entries, 0 to 999999
Data columns (total 3 columns):
column_1    1000000 non-null object
column_2    1000000 non-null object
column_3    1000000 non-null object
dtypes: object(3)
memory usage: 188.8 MB