New to Python? Learn Pandas step by step — read CSV files, clean data, filter rows, and create charts. No advanced coding required.
Abhishek Raj
June 23, 202611 min read
SQL and Excel handle most MIS work. But Python becomes useful when you need to:
Pandas is the most important Python library for data analysis. Think of it as Excel for programmers — tables, filters, formulas, but faster and repeatable.
pip install pandas matplotlib openpyxl
analysis.py and start codingimport pandas as pd
# From CSV
df = pd.read_csv("sales_data.csv")
# From Excel
df = pd.read_excel("mis_report.xlsx", sheet_name="Sales")
print(df.head()) # First 5 rows
print(df.info()) # Column names and data types
df is a DataFrame — like an Excel sheet in Python.
print(df.isnull().sum()) # Missing values per column
print(df.duplicated().sum()) # Duplicate rows
print(df.describe()) # Min, max, average for numbers
Always inspect before analyzing. Dirty data = wrong insights.
# Sales in North region above 10,000
north_high = df[(df["Region"] == "North") & (df["SalesAmount"] > 10000)]
# This month only
june_sales = df[df["OrderDate"] >= "2026-06-01"]
summary = df.groupby("ProductCategory")["SalesAmount"].agg(
TotalSales="sum",
AvgSales="mean",
OrderCount="count"
).reset_index()
print(summary.sort_values("TotalSales", ascending=False))
# Fill missing region with "Unknown"
df["Region"] = df["Region"].fillna("Unknown")
# Drop rows with no sales amount
df = df.dropna(subset=["SalesAmount"])
import matplotlib.pyplot as plt
top_products = df.groupby("ProductName")["SalesAmount"].sum().nlargest(10)
top_products.plot(kind="bar", title="Top 10 Products by Sales")
plt.ylabel("Sales Amount")
plt.tight_layout()
plt.savefig("top_products.png")
Share the PNG in emails or PowerPoint — quick visual for managers.
summary.to_excel("monthly_summary.xlsx", index=False)
summary.to_csv("monthly_summary.csv", index=False)
| Task | Best tool |
|---|---|
| Daily MIS from database | SQL + Power BI |
| Quick ad-hoc analysis | Excel |
| Messy CSV from multiple sources | Pandas |
| Reproducible monthly analysis | Pandas script |
| Interactive dashboard | Power BI |
Pandas is not magic — it is a faster, repeatable way to do what you already do in Excel. Start with one real work dataset, automate one boring weekly task, and build from there.
More to read
More from Python and related topics.
Abhishek RajJune 22, 2026
How to use ChatGPT and GenAI safely for SQL, Excel, Power BI, and report writing — with prompt examples any analyst can copy and use.
Abhishek RajAugust 14, 2024
Step-by-step guide to cleaning messy real-world datasets using Python Pandas.
Abhishek RajJune 28, 2026
New to data analytics? Learn what a Data Analyst actually does, skills you need, salary range in India, and how to start — explained in plain English.