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 Read CSV in Python
Next article icon

Pandas Functions in Python: A Toolkit for Data Analysis

Last Updated : 07 Aug, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report

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 professional, Pandas functions can help you to save time and effort when working with a dataset. In this article, we will provide a detail overview of the most important Pandas functions. We've also provide links to detailed articles that explain each function in more detail.

By the end of this article, you will have a solid understanding of the each functions of pandas in python that you need to know for Data Analysis as well as Data Science and you will be able to use these functions to load, clean, transform, and analyze data with ease.

List of Important Pandas Functions

Here are the list of some of the most important Pandas functions:

Function

Description

Pandas read_csv() FunctionThis function is used to retrieve data from CSV files in the form of a dataframe.
Pandas head() FunctionThis function is used to return the top n (5 by default) values of a data frame or series.
Pandas tail() FunctionThis method is used to return the bottom n (5 by default) rows of a data frame or series.
Pandas sample() FunctionThis method is used to generate a sample random row or column from the data frame.
Pandas info() FunctionThis method is used to generate the summary of the DataFrame, this will include info about columns with their names, their datatypes, and missing values.
Pandas dtypes() FunctionThis method returns a Series with the data type of each column.
Pandas shape() FunctionIt returns a tuple representing the dimensionality of the Pandas DataFrame.
Pandas size() FunctionThis method returns the number of rows in the Series. Otherwise, return the number of rows times the number of columns in the DataFrame.
Pandas ndim() FunctionThis function returns 1 if Series and 2 if DataFrame
Pandas describe() FunctionReturns descriptive statistics about the data like mean, minimum, maximum, standard deviation, etc.
Pandas unique() FunctionIt returns all the unique values in a particular column.
Pandas nunique() FunctionReturns the number of unique values in the column
Pandas isnull() FunctionReturns the DataFrame/Series of the boolean values. Missing values gets mapped to True and non-missing value gets mapped to False.
Python isna() Function
 
Returns dataframe/series with bool values. Missing values gets mapped to True and non-missing gets mapped to False.
Pandas fillna() FunctionThis function is used to trim values at a specified input threshold.
 
Pandas clip() FunctionReturns index information of the DataFrame.
 
Pandas columns() FunctionReturns column names of the dataframe
 
Pandas sort_values() FunctionThis method sorts the data frame in ascending or descending order of passed Column.
Pandas value_counts() FunctionReturns the counts of the unique values in a series or from a dataframe's column
 
Pandas nlargest() FunctionUsed to get n largest values from a data frame or a series.
Pandas nsmallest() FunctionUsed to get n smallest values from a data frame or a series.
Pandas copy() FunctionTo copy DataFrame in Pandas.
 
Pandas loc() FunctionUsed to access a group of rows and columns by label(s) or a boolean array in the given dataframe.
Pandas iloc() FunctionThis method is used to retrieve rows from a dataframe.
 
Pandas rename() FunctionThis method is used to rename any index, column, or row.
Pandas where() FunctionThis method is used to check a data frame for one or more conditions and return the result accordingly.
Pandas drop() FunctionUsed to drop rows/columns from a dataframe.
 
Pandas groupby() FunctionUsed to group data based on some criteria.
 
Pandas corr() FunctionThis function is used to find the correlation among the columns in the Dataframe.
Pandas query() Function
 
To filter dataframe based on a certain condition.
Pandas insert() FunctionThis method allows us to insert a column at any position.
 
Pandas sum() Function
 
It returns the sum of the values for the requested axis.
Pandas mean() FunctionIt returns the mean of the values for the requested axis.
Pandas median() FunctionIt returns the median of the values for the requested axis.
Pandas std() FunctionIt returns sample standard deviation over the requested axis.
Pandas apply() FunctionUsing this we can apply a function to every row in the given dataframe. 
Pandas merge() FunctionUsed to merge two Pandas dataframes.
Pandas astype() FunctionThis method is used to cast pandas object to a specified dtype.
Pandas set_index() FunctionThis method is used to set a List, Series or Data frame as an index of a Data Frame.
Pandas reset_index() FunctionThis method is used to reset the index of a Data Frame.
Pandas at() FunctionThis method is used to return data in a dataframe at the passed location.
Pandas iterrows() FunctionThis function is used to iterate over Pandas Dataframe rows in the form of (index, series) pair.
Pandas iteritems() FunctionThis function iterates over the given series object. 
Pandas to_datetime() FunctionThis method helps to convert the string Date time into a Python Date time object.
Pandas to_numeric() FunctionThis method is used to convert an argument to a numeric type.
Pandas to_string() FunctionThis method is used to render the given DataFrame to a console-friendly tabular output.
Pandas concat() FunctionThis function is used to concatenate dataframes along a particular axis.
Pandas cov() FunctionThis method is used to compute the pairwise covariance of columns.
Pandas duplicated() FunctionThis method helps in analyzing duplicate values only. It returns a boolean series which is True only for Unique elements.
Pandas drop_duplicates() FunctionThis method removes the duplicates from Pandas's dataframe.
Pandas dropna() FunctionThis method helps in dropping Rows/Columns with Null values
Pandas diff() FunctionThis method is used to find the first discrete difference of objects over the given axis. 
Pandas rank() FunctionThis method returns a rank of every respective index of a series passed. The rank is returned on the basis of position after sorting.
Pandas mask() Function 
Pandas resample() FunctionThis method is used to resample the Time Series data.
Pandas transform() FunctionThis function calls a function on self-producing a DataFrame with transformed values that have the same axis length as self.
Pandas replace() FunctionThis function is used to replace values.
Pandas to_csv() FunctionThis function is used to write series/dataframe objects to comma-separated values (csv) files.
Pandas to_excel() FunctionThis method is used to export the DataFrame to the Excel file. 
Pandas_to_sql() FunctionThis function is used to write the given dataframe to a SQL database.
Pandas plot() FunctionThis method is used to plot dataframe.

Next Article
Pandas Read CSV in Python
author
kartik
Improve
Article Tags :
  • Pandas
  • AI-ML-DS
  • Python-pandas

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