What is info function in Pandas?

The info function in Pandas is displays a summary of the dataframe. It displays column names, data types, the number of non-null values, and memory usage.

Syntax

The syntax of the info function is as follows:

DataFrame.info(verbose=None, buf=None, max_cols=None, memory_usage=None, show_counts=None, null_counts=None)

Parameters

All parameters are optional for the info function. Parameters and their descriptions are given below:

Parameters Description
verbose Determines whether the full summary is to be printed. Takes a bool value. By default, the setting in pandas.options.display.max_info_columns is followed.
buf Determines where to send the output. By default, the output is printed to sys.stdout.
max_cols Determines when to switch from the verbose to the truncated output. Takes an int variable. 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 Determines 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.
show_counts Determines whether to show non-null value counts or not. A value of True will always show the counts, while False never shows the counts.

Return value

The info function does not return anything. Instead, it outputs a concise summary of the dataframe.

Examples

The code snippet below shows how we can use the info function in Pandas:

If verbose = False, column information is not printed.

memory_usage can be altered while dealing with larger dataframes.

import pandas as pd
import numpy as np
# Creating a dataframe
int_values = [1, 2, 3, np.NAN, 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})
print("Original Dataframe")
print(df)
print('\n')
# With verbose = True
print(df.info(verbose=True))
print('\n')
# With verbose = False
print(df.info(verbose=False))
print('\n')
# Changing mempry usage
print(df.info(memory_usage='deep'))
New on Educative
Learn any Language for FREE all September 🎉,
For the entire month of September, get unlimited access to our entire catalog of beginner coding resources.
🎁 G i v e a w a y
30 Days of Code
Complete Educative’s daily coding challenge every day in September, and win exciting Prizes.

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved