CDPL Logo
Cinute Digital
Home
ServicesEventMentors
BlogContact

Data Science

  • Data Science - OverviewComprehensive Data Science and AI - Master ProgramMachine Learning and Data Science with PythonDeep Learning, NLP and Generative AIAdvanced Data Science & Machine Learning MasterclassMachine Learning Algorithms using python ProgrammingMachine Learning and Data Visualization using R ProgrammingPython Programming

Artificial Intelligence(AI)

  • Artificial Intelligence (AI) - OverviewPrompt Engineering with Gen AI

Software Testing Courses

  • Software Testing - OverviewManual Software TestingAPI Testing using POSTMAN and RestAPIsDatabase Management System using MySQLETL Testing CourseAdvanced Software TestingAdvanced Automation TestingAdvanced Manual and Automation TestingAdvanced Manual and Automation TestingJava Programming

Digital Marketing

  • Digital Marketing - OverviewDigital Marketing and Analytics - Master ProgramDigital Marketing and AI (For Business Owners)Digital Marketing With AI Bootcamp

Business Development(BI)

  • Business Intelligence (BI) - OverviewAdvanced Data Analytics - Hero ProgramAdvanced Data Analytics with Python LibrariesExcel for Data Analytics & VisualizationData Analytics & Visualization with TableauData Analytics & Visualization with Power BIData Analytics With BI And Big Data Engineering - Master Program

Blogs

  • BlogsSoftware TestingData ScienceWeb DevelopmentAI & Machine LearningDigital Marketing

Services

  • Campus to CorporateCustom TrainingExpert TalksFaculty DevelopmentGovt & Public Sector TrainingIndustrial VisitsInternship ProgramOn Job TrainingShort Term Training Program (STTP)Train the TrainerWorkshops

Certifications and Accreditation

  • AAA CertificationACTD CertificationValidate Your Certificate

Events

  • Business Analytics Course (Aldel Institute)MoU Signing (St. Francis)Job Fair (Nirmala Memorial)Industrial Visit (VIVA Institute)National Conference on AI (MKES)FDP on Power BI & Tableau (Bhavans College)Internship Program (DJ Sanghvi)TechoutsavIndustrial Visit (Thakur College)Placement Drive (Tech Mahindra)

Follow Us On

Follow Us On

Institute

  • HomeCMS LoginMock TestISTQB RegistrationServicesEventsMentorsPlacementsLive JobsJob OpeningsCareersAbout CDPLOur TeamReviewsAffiliate ProgramContact Us

Loading...

Loading...

All BlogsWeb DevelopmentData SciencePython ProgrammingArtificial Intelligence and Machine Learning (AI/ML)Digital MarketingBusiness Intelligence (BI)Software TestingArtificial IntelligenceAll Categories

Loading...

Ready for Career Guidance?

At CDPL Ed-tech Institute, we provide expert career advice and counselling in AI, ML, Software Testing, Software Development, and more. Apply this checklist to your content strategy and elevate your skills. For personalized guidance, book a session today.

City Wise

Software Testing City Wise

  • Software Testing Course in MumbaiSoftware Testing Course in DelhiSoftware Testing Course in AhmedabadSoftware Testing Course in ChennaiSoftware Testing Course in BengaluruSoftware Testing Course in PuneSoftware Testing Course in KolkataSoftware Testing Course in Hyderabad

Data Science City Wise

  • Data Science Course in MumbaiData Science Course in DelhiData Science Course in AhmedabadData Science Course in ChennaiData Science Course in BengaluruData Science Course in PuneData Science Course in KolkataData Science Course in Hyderabad

Business Intelligence City Wise

  • Business Intelligence Course in MumbaiBusiness Intelligence Course in delhiBusiness Intelligence Course in AhmedabadBusiness Intelligence Course in ChennaiBusiness Intelligence Course in BengaluruBusiness Intelligence Course in PuneBusiness Intelligence Course in KolkataBusiness Intelligence Course in Hyderabad

Artificial Intelligence City Wise

  • Artificial Intelligence Course in MumbaiArtificial Intelligence Course in delhiArtificial Intelligence Course in AhmedabadArtificial Intelligence Course in ChennaiArtificial Intelligence Course in BengaluruArtificial Intelligence Course in PuneArtificial Intelligence Course in KolkataArtificial Intelligence Course in Hyderabad

Digital Marketing City Wise

  • Digital Marketing Course in MumbaiDigital Marketing Course in delhiDigital Marketing Course in AhmedabadDigital Marketing Course in ChennaiDigital Marketing Course in BengaluruDigital Marketing Course in PuneDigital Marketing Course in KolkataDigital Marketing Course in Hyderabad
View All
Cinute Digital logo

Cinute Digital

Get In Touch

Head Office (CDPL)

Office #1, 2nd Floor, Ashley Tower, Kanakia Road, Vagad Nagar, Beverly Park, Mira Road, Mira Bhayandar, Mumbai, Maharashtra 401107

Study Center MeghMehul Classes (Vasai)

Shop No 7, Laxmi Palace, Opposite Vidhyavardhini Degree Engineering College, Gurunanak Nagar, Vasai West, Mumbai, Maharashtra - 401202
contact@cinutedigital.com
+91 78-883-837-88|+91 84-889-889-84
MSME
Skill India
Trustpilot
ISO 27001 Certified
ISO 9001 Certified
Privacy PolicyCookies PolicyTerms and ConditionsCancellation/Refund Policy

ISO 9001:2015 (QMS) 27001:2013 (ISMS) Certified Company.

© 2026 Cinute Digital Pvt. Ltd. — All Rights Reserved.

Powered By

Testriq_logo

Pandas Tutorial: 30 Must-Know Functions With Real Datasets

Shoeb Shaikh
Shoeb Shaikh

Shoeb Shaikh is a seasoned Software Testing and Data Science Expert and a Mentor with over 14 years of experience in the field. Specialist in designing and managing processes, and leading high-performing teams to deliver impactful results.

November 5, 2025•5 min read
Pandas Tutorial: 30 Must-Know Functions With Real Datasets

Master the 80 20 of Pandas. From read_csv and merge to groupby, pivot_table, apply, and time series tricks, each function includes a short example on realistic data.

Learn 30 essential Pandas functions with copy paste examples on real datasets. A CDPL focused tutorial for analysts, data scientists, and students.

Introduction

Pandas is the workhorse of data analysis in Python. For Cinute Digital Pvt Ltd (CDPL) learners and partner teams, this tutorial covers the 30 functions that deliver most day to day value. Each snippet uses realistic mini datasets so you can copy, run, and adapt to your projects.

Tip: Keep a notebook open and paste each block to build your own cheat sheet.

Setup and Sample Data

import pandas as pd

# Orders dataset
orders = pd.DataFrame({
    "order_id":[101,102,103,104,105],
    "user_id":[1,1,2,3,2],
    "country":["IN","IN","AE","IN","AE"],
    "amount":[1200,800,560,1500,300],
    "order_date": pd.to_datetime(["2025-10-01","2025-10-02","2025-10-02","2025-10-03","2025-10-03"])
})

# Users dataset
users = pd.DataFrame({
    "user_id":[1,2,3],
    "name":["Asha","Bilal","Chirag"],
    "segment":["pro","basic","pro"]
})

Two small but realistic tables we will reuse through the tutorial

Import, Inspect, and Save

read_csv load a CSV

df = pd.read_csv("sales.csv")  # delimiter, dtype, parse_dates are useful args

to_csv save a CSV

orders.to_csv("orders_out.csv", index=False)

head and tail quick peek

orders.head(3); orders.tail(2)

info schema and nulls

orders.info()

describe stats summary

orders.describe(numeric_only=True)

Selecting and Filtering

loc label based select

orders.loc[orders["country"]=="IN", ["order_id","amount"]]

iloc position based select

orders.iloc[:3, :2]

query readable filters

orders.query("amount >= 800 and country == 'IN'")

isin membership

orders[orders["country"].isin(["IN","AE"])]

between numeric ranges

orders[orders["amount"].between(500,1200)]

Transformation and Features

assign create columns

aug = orders.assign(gst=lambda d: d.amount * 0.18, total=lambda d: d.amount * 1.18)

astype convert types

orders["user_id"] = orders["user_id"].astype("int64")

replace value mapping

orders["country"] = orders["country"].replace({"IN":"India","AE":"UAE"})

cut and qcut binning

orders["amount_bucket"] = pd.qcut(orders["amount"], q=3, labels=["low","med","high"])

apply row or column wise logic

orders["flag_big"] = orders["amount"].apply(lambda x: x >= 1000)

Missing Data and Cleaning

isna and notna

orders.isna().sum()

fillna impute values

orders["amount"] = orders["amount"].fillna(orders["amount"].median())

dropna remove null rows

orders = orders.dropna(subset=["amount"])

drop_duplicates deduplicate

orders = orders.drop_duplicates(["order_id"])

rename readable columns

orders = orders.rename(columns={"order_date":"date"})

Join, Group, and Pivot

merge relational join

joined = orders.merge(users, on="user_id", how="left")

groupby aggregate by keys

joined.groupby("country")["amount"].agg(["count","mean","sum"]).reset_index()

pivot_table quick reporting

pd.pivot_table(joined, values="amount", index="country", columns="segment", aggfunc="sum", fill_value=0)

melt unpivot for tidy data

wide = pd.DataFrame({"city":["Mumbai","Dubai"],"Q1":[10,8],"Q2":[12,11]})
tidy = wide.melt(id_vars="city", var_name="quarter", value_name="sales")

crosstab frequency table

pd.crosstab(joined["country"], joined["segment"])

Dates, Windows, and Sorting

to_datetime parse dates

orders["date"] = pd.to_datetime(orders["order_date"])

dt accessors for features

orders["dow"] = orders["date"].dt.day_name()

sort_values ordering

orders.sort_values(["amount","date"], ascending=[False, True])

rolling window metrics

orders.sort_values("date", inplace=True)
orders["rolling_total"] = orders["amount"].rolling(window=2).sum()

nlargest and nsmallest top k

orders.nlargest(3, "amount")[["order_id","amount"]]

Mini Project: Daily Revenue by Country and Segment

Combine several functions to answer a realistic question.

report = (
    orders.merge(users, on="user_id", how="left")
          .assign(date=lambda d: pd.to_datetime(d["order_date"]))
          .groupby(["date","country","segment"], as_index=False)["amount"]
          .sum()
)

# Pivot to a dashboard friendly view
dashboard = pd.pivot_table(
    report, values="amount",
    index=["date","country"], columns="segment",
    aggfunc="sum", fill_value=0
).reset_index()

print(dashboard.head())

From raw orders to a tidy report you can chart in seconds

Common Pitfalls and Quick Fixes

  • Wrong dtype for ids or codes use string types to keep leading zeros.
  • Silent date parsing issues always run pd.to_datetime with format if known.
  • Unexpected duplicates on merge check key uniqueness with value_counts before joining.
  • Groupby returning index use as_index=False or reset_index for flat tables.
  • Chained assignment warnings prefer .loc for explicit assignment.

Practice Datasets You Can Try

  • Orders and users from your project database export.
  • Retail sales by month from a public government portal.
  • Website events CSV from analytics tools.
  • Helpdesk tickets with status and resolution time.

Create a folder with raw, interim, and processed CSVs to mirror a simple data workflow.

Conclusion

You now have a compact toolkit of 30 Pandas functions that handle most everyday analysis. Keep this page as a reference, and turn the mini project into a dashboard or a report. Consistent practice with real data is the fastest way to mastery.

Tags

#pandas tutorial#pandas functions#python data analysis#real datasets#data science#data wranglingpandas cheat sheet", "CDPL Cinute Digital##
Shoeb Shaikh
Shoeb Shaikh

Shoeb Shaikh is a seasoned Software Testing and Data Science Expert and a Mentor with over 14 years of experience in the field. Specialist in designing and managing processes, and leading high-performing teams to deliver impactful results.

November 5, 2025•5 min read

Share this article

TwitterLinkedInFacebook

Related Posts

1

Is Big Data Spark the Best IT Skill for Freshers ?

Data Science
2

Model Deployment with Flask: Land an ₹8 LPA ML Job

Data Science
3

Master Excel Analytics: Beginner Tips That Pay in 2026

Data Science
4

Ultimate Guide: How to Clean Data and Get Hired Fast

Data Science
5

Simple Machine Learning Algorithms to Kickstart Your Career

Data Science

Categories

Web Development7Data Science16Python Programming2Artificial Intelligence and Machine Learning (AI/ML)2Digital Marketing7Business Intelligence (BI)8Software Testing13Artificial Intelligence5
View All Categories

Newsletter

Get the latest articles and insights delivered directly to your inbox.

No spam. Unsubscribe anytime.

Popular Tags

#Python#Backend Development#Web Development#Django#Flask#Data Engineering#Apache Spark#IT Careers India#Fresher Jobs#PySpark