Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Data preprocessing
  • Data Manipulation
  • Data Analysis using Pandas
  • EDA
  • Pandas Exercise
  • Pandas AI
  • Numpy
  • Matplotlib
  • Plotly
  • Data Analysis
  • Machine Learning
  • Data science
Open In App
Next Article:
Pandas DataFrame dtypes Property | Find DataType of Columns
Next article icon

Python | Pandas dataframe.info()

Last Updated : 03 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

The `dataframe.info()` function in Pandas proves to be an invaluable tool for obtaining a succinct summary of a dataframe. This function is particularly useful during exploratory analysis, offering a quick and informative overview of the dataset. Leveraging `dataframe.info()` is an efficient way to gain insights into the structure and characteristics of the data, making it an essential step in the data analysis workflow.

Pandas dataframe.info() Syntax


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

Parameters: 

  • verbose : Whether to print the full summary. None follows the display.max_info_columns setting. True or False overrides the display.max_info_columns setting. 
  • buf : writable buffer, defaults to sys.stdout 
  • max_cols : Determines whether full summary or short summary is printed. None follows the display.max_info_columns setting. 
  • memory_usage : Specifies whether total memory usage of the DataFrame elements (including index) should be displayed. None follows the display.memory_usage setting. True or False overrides the display.memory_usage setting. A value of ‘deep’ is equivalent of True, with deep introspection. Memory usage is shown in human-readable units (base-2 representation).
  • null_counts : Whether to show the non-null counts. If None, then only show if the frame is smaller than max_info_rows and max_info_columns. If True, always show counts. If False, never show counts.

For link to the CSV file used in the code, click here

What is dataframe.info() Function in Pandas ?

The `DataFrame.info()` function in Pandas is a method used to obtain a concise summary of a DataFrame’s structure and information. When called on a Pandas DataFrame, it provides essential details such as the total number of non-null values, data types of each column, and memory usage. This summary is beneficial for quickly assessing the completeness of the dataset, identifying potential missing values, and understanding the overall data types present in the DataFrame.

Pandas dataframe.info() Examples

There are some examples of dataframe.info() examples those shown the advantages uses of the dataframe.info() function. those are following.

Printing the summary of a DataFram using Pandas info() Function 

In this example code utilizes the pandas library to work with tabular data in Python. It imports the library as ‘pd’ and reads a CSV file named “nba.csv” into a DataFrame (df). Finally, it prints the contents of the DataFrame, displaying the structured representation of the data from the CSV file.

Python
# importing pandas as pd import pandas as pd  # Creating the dataframe  df = pd.read_csv("nba.csv")  # Print the dataframe df 

Output :

second-print-

Print the Full Summary of the Dataframe

In below example code uses the `info()` method on a DataFrame named `df` to display a concise summary of its structure.

Python
# to print the full summary df.info() 

Output : 

final-reviewAs we can see in the output, the summary includes list of all columns with their data types and the number of non-null values in each column. we also have the value of rangeindex provided for the index axis. 

Summarize a DataFrame in Pandas use info() Function

Note : In order to print the short summary, we can use the verbose parameter and set it to False.

In this example code utilizes the Pandas library to handle tabular data. It imports the library as ‘pd’ and reads a CSV file named “nba.csv” into a Pandas DataFrame called ‘df’. The last line prints a concise summary of the DataFrame, excluding verbose details, using the `info()` function with the parameter ‘verbose’ set to False. This summary includes information about the columns, data types, and memory usage.

Python
# importing pandas as pd import pandas as pd  # Creating the dataframe  df = pd.read_csv("nba.csv")  # Print the short summary of the  # dataframe by setting verbose = False df.info(verbose = False) 

Output : 


As, we can see in the output, the summary is very crisp and short. It is helpful when we have 1000s of attributes in dataframe. 

Use info() Function to Print a Full Summary of the Dataframe and Exclude the Null-Counts

Note : In order to print the full summary with null counts excluded, we can use the show_counts parameter and set it to False.

In this example, the code uses the Pandas library in Python to read a CSV file named “nba.csv” into a DataFrame called df. The last line prints a concise summary of the DataFrame, including its structure, data types, and non-null counts for each column, with null counts excluded using show_counts=False.

Python
import pandas as pd  # Creating the dataframe   df = pd.read_csv("nba.csv")  # Print the full summary of the dataframe with null counts excluded df.info(verbose=True, show_counts=False) 

Output : 


As, we can see in the output, the summary is full but null-counts are excluded.



Next Article
Pandas DataFrame dtypes Property | Find DataType of Columns

S

Shubham__Ranjan
Improve
Article Tags :
  • Python
  • Technical Scripter
  • Pandas-DataFrame-Methods
  • Python pandas-dataFrame
  • Python-pandas
Practice Tags :
  • python

Similar Reads

  • Pandas Functions in Python: A Toolkit for Data Analysis
    Pandas is one of the most used libraries in Python for data science or data analysis. It can read data from CSV or Excel files, manipulate the data, and generate insights from it. Pandas can also be used to clean data, filter data, and visualize data. Whether you are a beginner or an experienced pro
    6 min read
  • Pandas Read CSV in Python
    CSV files are the Comma Separated Files. It allows users to load tabular data into a DataFrame, which is a powerful structure for data manipulation and analysis. To access data from the CSV file, we require a function read_csv() from Pandas that retrieves data in the form of the data frame. Here’s a
    7 min read
  • Python | Pandas Dataframe/Series.head() method
    Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric Python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas head() method is used to return top n (5 by default) rows of a data frame or se
    2 min read
  • Pandas Dataframe/Series.tail() method - Python
    Python is a popular language for data analysis because it has many useful libraries. One of these libraries is Pandas, which makes working with data easier. The .tail() method in Pandas helps us see the last n rows of a DataFrame or Series. This is useful when dealing with large datasets and we need
    2 min read
  • Pandas Dataframe.sample() | Python
    Pandas DataFrame.sample() function is used to select randomly rows or columns from a DataFrame. It proves particularly helpful while dealing with huge datasets where we want to test or analyze a small representative subset. We can define the number or proportion of items to sample and manage randomn
    2 min read
  • Python | Pandas dataframe.info()
    The `dataframe.info()` function in Pandas proves to be an invaluable tool for obtaining a succinct summary of a dataframe. This function is particularly useful during exploratory analysis, offering a quick and informative overview of the dataset. Leveraging `dataframe.info()` is an efficient way to
    4 min read
  • Pandas DataFrame dtypes Property | Find DataType of Columns
    Pandas DataFrame is a two-dimensional size-mutable, potentially heterogeneous tabular data structure with labeled axes (rows and columns).  Pandas DataFrame.dtypes attribute returns a series with the data type of each column. Example: [GFGTABS] Python import pandas as pd df = pd.DataFrame({'Weig
    3 min read
  • Pandas df.size, df.shape and df.ndim Methods
    Understanding structure of our data is an important step in data analysis and Pandas helps in making this easy with its df.size, df.shape and df.ndim functions. They allow us to identify the size, shape and dimensions of our DataFrame. In this article, we will see how to implement these functions in
    2 min read
  • Pandas DataFrame describe() Method
    describe() method in Pandas is used to generate descriptive statistics of DataFrame columns. It gives a quick summary of key statistical metrics like mean, standard deviation, percentiles, and more. By default, describe() works with numeric data but can also handle categorical data, offering tailore
    3 min read
  • Python | Pandas Series.unique()
    Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric Python packages. Pandas is one of those packages, and makes importing and analyzing data much easier. While analyzing the data, many times the user wants to see the unique values in a par
    1 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences