Python for Data Analytics Guide
The core libraries, a first pandas analysis, merging safely, a Matplotlib chart, notebook habits, common errors and a question-first way to learn.
9 programs
Choose the best training program according to your career.
Improve the performance of your business with our innovative Industrial Training Program.
Read More →
Our instructor-led training classes are designed to make you an expert.
Read More →
Real-life case studies are a great way to demonstrate your practical knowledge.
Read More →
Explore blogs, latest technologies and industry updates with practical examples.
Read More →Browse all available training programs and choose the right one for your career.
Read More →Know more about who we are and what we stand for.
Discover our mission to equip individuals with essential IT skills and industry expertise.
Read More →Learn, practice and plan your career — bilkul free.
Book a free video counselling session and pick the right course for you.
Read More →Download the Python for data analytics guide PDF from Uncodemy: pandas, NumPy, cleaning, charts and a workflow with runnable examples.
This page offers Uncodemy's Python for data analytics guide as a PDF download. Python lets analysts clean, combine, summarise and chart data in a repeatable way. The guide explains the setup, the core pandas operations, a first visualisation and good habits for notebooks, with examples you can run on a small file.
The download below is its own file. It covers setup, core pandas operations, safe merging, a first chart, notebook habits and the errors beginners meet most often.
The core libraries, a first pandas analysis, merging safely, a Matplotlib chart, notebook habits, common errors and a question-first way to learn.
Python is a general-purpose language with a rich ecosystem for data work. Analysts use it when a task is too large or too repetitive for a spreadsheet, when it needs careful cleaning, or when the work should be repeatable by simply running a script again. Its libraries cover tables with pandas, numbers with NumPy, charts with Matplotlib and Seaborn, and statistics with SciPy and statsmodels. You do not need to become a software engineer to benefit from it. A small set of operations, used consistently, covers a surprising share of analyst tasks.
| Library | What it does | Typical use |
|---|---|---|
| pandas | Tables called DataFrames | Load, clean, filter, group and merge data |
| NumPy | Fast numeric arrays | Calculations and the foundation under pandas |
| Matplotlib | Plotting | Line, bar, scatter and histogram charts |
| Seaborn | Statistical charts on top of Matplotlib | Distributions and comparisons with less code |
| SciPy and statsmodels | Statistics | Tests, regression and distributions |
| Jupyter | Notebooks | Mixing code, results and notes |
Load a CSV, check it, filter, group and sort. The file and column names are examples.
import pandas as pd
df = pd.read_csv("orders.csv", parse_dates=["order_date"])
print(df.shape)
print(df.info())
print(df.isna().sum())
valid = df[df["status"] != "cancelled"]
by_city = (
valid.groupby("city")["order_total"]
.agg(orders="count", revenue="sum", avg="mean")
.sort_values("revenue", ascending=False)
.round(2)
)
print(by_city.head(10))
Join orders to customers, and verify that the row count did not change unexpectedly.
orders = pd.read_csv("orders.csv")
customers = pd.read_csv("customers.csv")
merged = orders.merge(customers, on="customer_id", how="left", validate="many_to_one")
print(len(orders), len(merged)) # should be equal
print(merged["city"].isna().sum(), "orders without a matching customer")
Monthly revenue as a line chart with labelled axes and a finding-style title.
import matplotlib.pyplot as plt
monthly = (
valid.set_index("order_date")["order_total"]
.resample("MS").sum()
)
ax = monthly.plot(figsize=(7, 3), color="#F1582D")
ax.set_title("Monthly revenue")
ax.set_ylabel("Revenue")
ax.spines[["top", "right"]].set_visible(False)
plt.tight_layout()
plt.show()
| Task | Excel | SQL | pandas |
|---|---|---|---|
| Filter rows | Filter or FILTER() | WHERE | df[df[col] == x] |
| Total by group | Pivot table | GROUP BY | df.groupby(col).sum() |
| Combine tables | XLOOKUP | JOIN | df.merge() |
| Sort | Sort | ORDER BY | sort_values() |
After the basics, learn reshaping with pivot and melt, time-series operations, string cleaning and plotting with Seaborn. Then apply them to a complete project: pick a dataset, write the business question, clean, analyse, chart and write up. The ability to read other people's notebooks is also valuable, since much of real work is understanding and extending existing code.
Instead of studying Python in the abstract, start with a question about a dataset you care about, such as which month had the highest sales or how delivery times differ by city. Look up only the commands you need, run them, and write down what you learned. Over a few weeks you will collect a personal library of patterns for loading, filtering, grouping, merging and plotting. This question-first approach keeps motivation high and gives you working examples to reuse.
| Error | Likely cause | Fix |
|---|---|---|
| KeyError | Column name misspelled or has extra spaces | Print df.columns and strip names |
| SettingWithCopyWarning | Changing a slice of another DataFrame | Use .copy() or .loc for assignment |
| ValueError when merging | Key columns have different types | Convert both to the same type |
| Unexpected NaN after merge | Keys do not match | Check unmatched keys with indicator=True |
| Library | Use it for |
|---|---|
| pandas | Tables, cleaning, grouping and joining |
| NumPy | Fast numeric arrays and maths |
| Matplotlib and seaborn | Charts for exploration and reports |
| SciPy and statsmodels | Statistical tests and models |
| Jupyter | Notebooks that mix code, charts and notes |
Ready to learn Python for analysis with a trainer? Explore Uncodemy's Data Analytics course and learn from industry trainers.