Hiring Partners
Segilola Resources Operating LimitedTaviatech TechnologiesFCMBMTN NigeriaAdvans La Fayette Microfinance BankAboki AfricaFirst Bank of NigeriaOPay
โ† Basics of Data Analysis ยท Lesson 7 of 9

Module Six

๐Ÿ“– Every lesson in this course is free to read right here, no account needed. Create a free account to track your progress, take the exam, and earn your certificate.
7
Module 6: Introduction to Python for Data Analytics (Ages 13+)

๐Ÿ Module 6: Introduction to Python for Data Analytics

Basics of Data Analytics

Made for 13-year-olds โ€” teach a computer to be your data helper!

โฐ Time Needed: About 1โ€“2 weeks (this one's a bit bigger!)

๐ŸŽฏ Big Goal: Learn the basics of Python and use it to work with data

๐Ÿงฐ What You Need: A computer with internet access (we'll use free online tools โ€” no installation needed!)

๐ŸŒŸ What Will You Learn?

By the end of this module, you will be able to:

  • Explain what Python is and why data analysts love it.
  • Write simple Python code: variables, lists, and basic math.
  • Use a free online notebook to run Python code.
  • Load and explore a dataset using pandas (a Python tool for data).
  • Find basic statistics (average, max, min) with one line of code.

๐Ÿค– Lesson 1: What Is Python and Why Should You Care?

Python is a programming language โ€” a way of giving instructions to a computer. It's one of the most popular languages in the world, and it's especially popular for data analytics.

๐Ÿค– Think of it like this: A computer is like a super-fast robot that will do exactly what you tell it โ€” but it doesn't understand English. Python is how you "talk" to the robot. You give it clear instructions, and it follows them perfectly (even if you made a mistake!).

Why Do Data Analysts Love Python?

  • โšก Fast โ€” it can process thousands of rows in seconds.
  • ๐Ÿ” Repeatable โ€” once you write code, you can reuse it forever.
  • ๐Ÿงฐ Powerful tools โ€” special "libraries" like pandas and matplotlib do the hard work for you.
  • ๐Ÿ†“ Free โ€” Python costs nothing to download or use.
  • ๐ŸŒ Popular โ€” millions of people use it, so help is always easy to find.

Spreadsheets vs. Python

Task Spreadsheet Python
Small dataset (50 rows) โœ… Easy โœ… Easy
Huge dataset (1 million rows) โŒ Slow, may crash โœ… Fast
Repeating the same analysis ๐Ÿ˜“ Click everything again โœ… Run the same code
Making a chart โœ… Quick โœ… Also quick (with code)
๐Ÿ’ก Key Idea: Spreadsheets are great for small jobs. Python is great when you need speed, repetition, or really big data. You'll use both as a data analyst!

๐Ÿ’ป Lesson 2: Your First Python Code

You don't need to install anything! We'll use a free online tool. Ask a parent or teacher to help you open Google Colab (colab.research.google.com) or Replit (replit.com) โ€” both are free and run Python in your browser.

Hello, World! ๐Ÿ‘‹

The first thing every programmer learns is how to make the computer say hello:

print("Hello, World!")
Hello, World!

print() tells the computer to show something on the screen. Whatever is inside the quotes gets printed.

Variables โ€” Boxes for Storing Things ๐Ÿ“ฆ

A variable is like a labeled box where you store a value.

name = "Alex"
age = 13
favorite_sport = "soccer"

print(name)
print(age)
print(favorite_sport)
Alex 13 soccer

The = sign means "store this value in this box." It's not like math class โ€” it's an instruction!

Math in Python ๐Ÿงฎ

a = 10
b = 3

print(a + b)   # Addition
print(a - b)   # Subtraction
print(a * b)   # Multiplication
print(a / b)   # Division
13 7 30 3.3333333333333335

Anything after a # is a comment โ€” the computer ignores it. Comments are notes for humans!

๐Ÿ’ก Tip: Don't worry about making mistakes. Every programmer makes them constantly. The computer will tell you what went wrong โ€” read the error message, fix it, and try again!
๐Ÿ“ Think of it like a recipe: A variable is like a labeled bowl in your kitchen. When you write age = 13, you're putting "13" into a bowl labeled "age." Later, you can use that bowl in your recipe!

๐Ÿ“‹ Lesson 3: Lists โ€” Storing Lots of Data

A list is a way to store many values in one variable. It's like a row in a spreadsheet!

ages = [12, 13, 13, 14, 13, 15, 12]

print(ages)
print(ages[0])   # First item (counting starts at 0!)
print(ages[2])   # Third item
print(len(ages)) # How many items
[12, 13, 13, 14, 13, 15, 12] 12 13 7
โš ๏ธ Surprise! In Python, counting starts at 0, not 1. So ages[0] is the first item, and ages[2] is the third. This trips up almost every beginner โ€” you're not alone!

Useful Things You Can Do with Lists

scores = [85, 92, 78, 95, 88]

print(sum(scores))       # Add them all up
print(len(scores))       # How many scores
print(sum(scores) / len(scores))  # Average!
438 5 87.6

You just calculated the average with one line of code โ€” the same thing you did by hand in Module 4!

๐ŸŽ’ Think of it like your backpack: A list is like your backpack โ€” it holds many things (books, pencils, snacks) in one place. You can count how many things are inside, add new things, or pull out a specific item!

๐Ÿผ Lesson 4: Meet pandas โ€” Your Data Superpower

pandas is a free Python library that makes working with data much easier. It's like a super-powered spreadsheet inside Python.

Step 1: Import pandas

import pandas as pd

import means "bring in this tool." as pd gives it a short nickname so you don't have to type "pandas" every time.

Step 2: Load Your Data

pandas can read data from a CSV file (a common file type for data).

data = pd.read_csv("scores.csv")
print(data)

This loads the file into a DataFrame โ€” pandas' version of a spreadsheet table. It has rows and columns, just like Excel.

Step 3: Explore Your Data

pandas has built-in commands to explore data quickly:

data.head()        # Show first 5 rows
data.shape         # How many rows and columns
data.describe()    # Quick statistics (average, min, max, etc.)
data.mean()        # Average of each column
data.max()         # Biggest value in each column
data.min()         # Smallest value in each column
๐ŸŽฎ Think of it like this: data.describe() is like pressing a "give me a summary" button. Instead of doing all the math by hand, pandas does it for you in one line!

Step 4: A Real Example

Imagine you have a file called class_scores.csv with these columns: Name, Math, Science, English.

import pandas as pd

data = pd.read_csv("class_scores.csv")
print(data.head())
print(data.mean())
Name Math Science English 0 Alex 85 92 78 1 Jordan 78 88 85 2 Sam 92 95 90 3 Riley 70 75 68 4 Taylor 88 91 86 Math 82.6 Science 88.2 English 81.4 dtype: float64

With just a few lines, you loaded a file, looked at the first rows, and found the average of every subject!

๐Ÿ’ก Don't Memorize Everything: Even professional programmers look up commands all the time. The goal is to know what's possible, not to memorize every line.

๐ŸŽฏ Fun Activity: Python Detective

Your Mission: Use Python to explore a small dataset!

Step 1: Set Up

Ask a parent or teacher to help you open Google Colab or Replit. Create a new notebook.

Step 2: Try These Commands

Copy and run each of these in a new cell. Write down what happens!

# 1. Your first list
scores = [85, 92, 78, 95, 88, 70, 91]
print(scores)

# 2. Math with Python
print("The average is:", sum(scores) / len(scores))
print("The highest score is:", max(scores))
print("The lowest score is:", min(scores))
print("The total is:", sum(scores))

# 3. Your own list
# Make a list of your last 5 test scores (or use made-up ones)
my_scores = [___, ___, ___, ___, ___]
print("My average:", sum(my_scores) / len(my_scores))

Step 3: Experiment!

Try changing the numbers. What happens if you add more scores? What if you set one score to 100? What if you put a really low score like 0?

Step 4: Write It Up

In your notebook or on paper, write:

  1. What was the average of your scores?
  2. What happened when you added a very high or very low score?
  3. What was the most surprising thing you learned?
  4. One question you still have about Python.

Submit: A screenshot or copy of your Python code + your write-up.

๐Ÿ“ Quick Quiz

  1. What is Python?
  2. Name two reasons data analysts love Python.
  3. What does print("Hello") do?
  4. What is a variable? Give one example.
  5. If ages = [12, 13, 14], what is ages[0]?
  6. What does import pandas as pd do?
  7. What does data.mean() calculate?

๐Ÿ”‘ Key Words to Remember

  • Python โ€” a popular programming language used for data analytics.
  • Code โ€” instructions written for a computer.
  • Variable โ€” a named box that stores a value.
  • List โ€” a collection of values stored in order.
  • Print โ€” a command that shows something on the screen.
  • Comment โ€” a note in code (after #) that the computer ignores.
  • Library โ€” a collection of pre-written code you can use (like pandas).
  • pandas โ€” a Python library for working with tables of data.
  • DataFrame โ€” pandas' version of a table (rows + columns).
  • CSV โ€” a common file type for data (stands for "comma-separated values").

๐Ÿ“š Want to Learn More?

  • Try the free "Python" course on Kaggle Learn โ€” it's made for beginners.
  • Ask a parent or teacher about Code.org or Scratch โ€” fun ways to learn coding basics first.
  • Experiment in Google Colab โ€” it's free and saves your work automatically.
  • Don't worry about memorizing โ€” Google "how to do X in pandas" whenever you get stuck. Every programmer does!
โš ๏ธ You Don't Have to Be Perfect: The best way to learn Python is to make mistakes. Errors are normal. Every error message is a clue โ€” read it, fix it, try again. That's how real programmers work!
๐ŸŽ‰ Big Idea: Python is like learning a new language โ€” it feels weird at first, but after a while, you'll be "talking" to the computer without even thinking about it. And the best part? The computer will never get tired of doing your math homework!

© 2026 Basics of Data Analytics โ€” Module 6 (Ages 13+)

๐Ÿ† Get Certified

๐Ÿ”’

Earn this certificate

Every lesson is already free to read. Sign up, finish the lessons, pass the exam (โ‚ฆ2,000 or 20,000 coins), and get a verified certificate with your name on it.

๐ŸŽ“ Sign Up to Get Certified
๐Ÿ› ๏ธ Practice Tools
Hands-on simulators & labs - subscription required.
โ†’
๐ŸŽฏ Internship Tasks
Real-world tasks to build your portfolio - unlock them with a subscription.
โ†’