New cohort starts 11 January 2027 · Limited seats · Apply now

Python for Data Analysis: A Beginner’s First Steps With Pandas

Nov 5, 2026 | Python

Python for data analysis is the natural next step once Excel starts to feel slow or a dataset gets too messy. With the Pandas library you can clean, combine and summarise thousands or millions of rows in a few lines, and repeat the same steps next month with one click. This guide takes you through a first workflow in seven steps.

An instructor explaining a concept in a live session

Step 1: Install Python and Jupyter

The simplest route for beginners is the free Anaconda distribution, which includes Python, Pandas and Jupyter Notebook. Alternatively, install Python from python.org and run:

pip install pandas matplotlib jupyter
jupyter notebook

A notebook lets you run code one cell at a time and see the result straight away.

Step 2: Load your data

import pandas as pd

df = pd.read_csv("sales.csv")      # or pd.read_excel("sales.xlsx")
df.head()                           # first five rows

Step 3: Understand what you have

df.shape          # rows, columns
df.info()         # column types and missing values
df.describe()     # summary statistics for numeric columns

Look for columns stored as text that should be numbers or dates, and for missing values.

Step 4: Clean it

df["branch"] = df["branch"].str.strip().str.title()          # " ikeja " -> "Ikeja"
df["order_date"] = pd.to_datetime(df["order_date"], dayfirst=True)  # Nigerian DD/MM/YYYY dates
df = df.drop_duplicates()
df["amount"] = df["amount"].fillna(0)

Use dayfirst=True for dates written day-first, as they usually are in Nigeria, or 03/04/2026 becomes 4 March instead of 3 April.

Step 5: Filter and summarise

lagos = df[df["state"] == "Lagos"]

by_branch = (df.groupby("branch")["amount"]
               .agg(["count", "sum", "mean"])
               .sort_values("sum", ascending=False))
by_branch

groupby is the Pandas version of a pivot table.

monthly = df.set_index("order_date").resample("MS")["amount"].sum()
monthly.plot(title="Monthly revenue")

Step 7: Save your results

by_branch.to_csv("revenue_by_branch.csv")

Save your notebook to GitHub with a short README explaining the question, the data source and what you found. That turns practice into a portfolio project.

Excel vs Python for data analysis: when to switch

Situation Excel Python
Quick one-off summary Best Fine
Hundreds of thousands of rows Slow Best
Same report every month Manual Automated
Combining many files Painful Easy
Machine learning No Yes

Keep data safe

If your dataset contains names, phone numbers or emails, remove or mask them before analysis unless you truly need them, and never upload personal data to a public GitHub repository. That is good practice under the Nigeria Data Protection Act.

Where to go next

Learn merging (pd.merge), pivot_table and Seaborn charts, then move on to machine learning for beginners. Python for data analysis is module 3 of the Datamac data analytics courses, taught live with real Nigerian datasets.

FAQs

Is Python hard for beginners?

Python is one of the most readable programming languages. If you can write Excel formulas, you can learn the basics of Pandas.

Do I need Python to get a data analyst job?

Not always for entry-level roles, but it is increasingly expected and it sets you apart.

Can I run Python without installing anything?

Yes. Google Colab runs notebooks in your browser. Don’t upload confidential or personal data to it.

Keep reading

Learn this live with Datamac

Datamac’s 12-month data analytics internship teaches Excel, SQL, Python, Power BI, Tableau and machine learning in live online classes twice a week, with real Nigerian datasets, two capstones and career support.

Apply for the internship · Compare courses · Ask a question on WhatsApp

Learn this live in the new cohort.

Live classes twice a week, real Nigerian datasets, two capstones and career support.

Apply for new CohortCompare courses

Keep reading

No Results Found

The page you requested could not be found. Try refining your search, or use the navigation above to locate the post.