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.

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.
Step 6: Look at trends over time
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
- How to Become a Data Analyst in Nigeria With No Experience
- VLOOKUP vs XLOOKUP: Which Should You Use in 2026?
- Power BI vs Tableau for the Nigerian Job Market
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

