Hiring Partners
Segilola Resources Operating LimitedTaviatech TechnologiesFCMBMTN NigeriaAdvans La Fayette Microfinance BankAboki AfricaFirst Bank of NigeriaOPay
โ† Introduction to Python for Data Analysis ยท Lesson 2 of 9

Module One

๐Ÿ“– 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.
2
Module 1: Introduction to Python and Data Analysis The HTML lesson is below, structured for direct use in CRMNuggets LMS and written in beginner-friendly language for learners aged 13 and above.

Module 1: Introduction to Python and Data Analysis

1.1 What is Python?

Python is a popular programming language used to give instructions to computers. It helps people build websites, develop applications, automate tasks, create artificial intelligence systems, and analyse data.

Python is one of the best programming languages for beginners because its instructions are simple and easy to read.

Example: Imagine you own a supermarket in Ibadan. Every day, you record the amount of money you make from selling rice, beans, garri, and soft drinks. Instead of calculating everything manually, you can use Python to calculate your total sales and identify your best-selling products.

Python makes these calculations faster and easier.

1.2 What is Data Analysis?

Data analysis is the process of collecting, organising, cleaning, and studying information to discover useful facts and make better decisions.

Data can be numbers, names, dates, prices, examination scores, customer records, or sales information.

Example: Students' Examination Scores

Imagine a teacher records the examination scores of four students:

Student Score
Ada85
Tunde70
Musa90
Grace65

By analysing these scores, we can discover:

  • Musa has the highest score.
  • Grace has the lowest score.
  • The average score is 77.5.
  • Two students scored 80 or above.

Studying information to discover these facts is called data analysis.

1.3 Why Do Data Analysts Use Python?

Python is widely used in data analysis because it helps people work with information quickly and efficiently.

Here are five important reasons:

  • Easy to Learn: Python uses simple instructions that beginners can understand.
  • Saves Time: It can calculate information from thousands of records within seconds.
  • Cleans Data: It helps identify missing information, remove duplicate records, and correct errors.
  • Creates Charts: It can turn numbers into bar charts, line graphs, and other visual reports.
  • Free to Use: Python is open-source, so anyone can download and use it without paying for a programming language licence.

1.4 Real-Life Applications of Python in Data Analysis

Python is used in many industries to understand information and solve real-world problems.

  • Banking: Banks analyse transactions to identify unusual activities and possible fraud.
  • Healthcare: Hospitals study health records to understand patient trends.
  • Education: Schools analyse examination results to identify students who need extra lessons.
  • Business: Companies study sales records to understand customer behaviour.
  • Agriculture: Farmers analyse rainfall, crop production, and market prices.
  • Sports: Sports teams study player performance and match statistics.

Nigerian Business Example:

A supermarket in Lagos records its daily sales. A data analyst can use Python to discover which products sell most during weekends and which products customers buy less often.

The supermarket can use this information to plan its stock, avoid running out of popular products, and reduce waste.

1.5 Tools Used to Write Python Code

Before using Python, you need a programming environment where you can write and run instructions.

Some popular tools include:

  • Python IDLE: A simple programming environment that comes with many Python installations.
  • Visual Studio Code: A code editor that supports Python and other programming languages.
  • Jupyter Notebook: A tool that allows you to write and run Python code in separate sections while displaying results, charts, and explanations.
  • Google Colab: An online tool that allows you to write and run Python code using a web browser.

Beginner's Tip: Google Colab is a good place to start because you can practise Python without installing it on your computer.

1.6 Writing Your First Python Program

Let's write our first Python program.

Python uses a command called print() to display information on the screen.

Example 1:

print("Hello, Data Analyst!")

Output:

Hello, Data Analyst!

The print() command tells Python to display the message inside the brackets.

Example 2:

print("Welcome to Python for Data Analysis")
print("I am learning how to analyse data")

Output:

Welcome to Python for Data Analysis
I am learning how to analyse data

You can use the print() command to display names, numbers, messages, and calculation results.

1.7 Using Python to Calculate Sales

Imagine a shop owner wants to calculate the total sales made in three days.

The sales records are:

  • Monday: โ‚ฆ15,000
  • Tuesday: โ‚ฆ20,000
  • Wednesday: โ‚ฆ25,000

Python can calculate the total automatically.

Python Code:

monday = 15000
tuesday = 20000
wednesday = 25000

total_sales = monday + tuesday + wednesday

print(total_sales)

Output:

60000

The shop made โ‚ฆ60,000 in total sales.

Notice that we used words such as monday, tuesday, and wednesday to store the sales figures. These are called variables.

A variable is a named storage location that holds information in a computer program.

1.8 Summary of the Module

In this module, you have learned that:

  • Python is a programming language used to give instructions to computers.
  • Data analysis involves collecting, organising, cleaning, and studying information.
  • Python helps data analysts work with information faster.
  • Python is used in banking, healthcare, education, business, agriculture, and sports.
  • Google Colab, Jupyter Notebook, and Visual Studio Code are tools for writing Python code.
  • The print() function displays information on the screen.
  • Variables are used to store information in Python.

1.9 Practical Exercise

Now it is time to practise what you have learned.

  1. Write a Python program that displays your name.
  2. Write a program that displays the message "I want to become a Data Analyst".
  3. Create three variables containing the sales figures of three products.
  4. Use Python to calculate the total sales of the three products.
  5. Display the final result using the print() function.

Practical Challenge

A small shop sells the following products:

  • Rice: โ‚ฆ5,000
  • Beans: โ‚ฆ3,000
  • Garri: โ‚ฆ2,000

Your Task: Write a Python program that calculates the total amount made from selling these three products.

Hint: Create one variable for each product, add the three variables together, and use print() to display the total.

Key Lesson

Python is a powerful tool that helps data analysts work with information. You do not need to be an expert programmer to get started. Learn the basics, practise regularly, and gradually build your data analysis skills.

๐Ÿ† 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.
โ†’