Beginner Project • Basic Python

Python Data Explorer

Load, inspect, clean and summarize a small customer dataset before building your first Ai model.

0% complete
Your work is saved automatically.Complete the fields below. Your answers stay in this browser.

Prepare your first Python workspace

Project 02 introduces the shared Python and VS Code setup used by later coding projects. Complete this setup once; future projects will link back here instead of repeating it.

Part A

Install the required software

Download applications only from their official websites.

Required

1. Install Python

Download the current stable Python installer for your operating system and complete the installation.

Official Python download ↗python --versionOn some Windows systems, use py --version.
Required

2. Install VS Code

Download Visual Studio Code, run the installer and open the application after installation.

Official VS Code download ↗code --versionYou may also open VS Code from the Start menu.
Required

3. Add Python support

In VS Code, open Extensions, search for Python by Microsoft and select Install.

Microsoft Python extension ↗Python: Select InterpreterRun this command from the VS Code Command Palette.
Optional

4. Add Jupyter

Use Jupyter only if you prefer notebooks. The supplied Python script is enough to complete this project.

Official Jupyter installation ↗pip install jupyterlabSkip this installation when following the script route.
Part B

Create the project folders

Use File Explorer or Finder, then open the complete project folder in VS Code.

  1. Create a folder named project-02-python-data-explorer.
  2. Inside it, create two folders named data and outputs.
  3. Open VS Code and select File → Open Folder.
  4. Select project-02-python-data-explorer, then confirm that it appears in the Explorer panel.
  5. To create a missing file manually, select the New File icon beside the folder name in the Explorer panel and type its exact name, including the extension.
  6. Open the Command Palette with Ctrl + Shift + P, run Python: Select Interpreter and choose your installed Python version.
project-02-python-data-explorer/
├── data/
├── outputs/
├── data-explorer.py
├── README.md
└── requirements.txt
Part C

Download and place the starter files

Use the Starter Files section below, then move each download into the indicated location.

customer-data.csvMove to data/customer-data.csvdata-explorer.pyMove to the project’s main folderrequirements.txtMove to the project’s main folderREADME-template.pdfRead the PDF and use its sections to write your own README.mdProject worksheetOptional planning and findings record
Check file extensions

Confirm the files end with .py, .csv, .txt and .pdf. Windows may hide extensions; do not accidentally create names such as data-explorer.py.txt.

Part D

Install packages and confirm the setup

In VS Code, select Terminal → New Terminal. Confirm the terminal is inside your project folder, then run:

VS Code terminal
python -m pip install -r requirements.txt
python -c "import pandas, matplotlib; print('Setup complete')"
python data-explorer.py

Ready to begin when: the terminal prints Setup complete, the CSV loads, and the script displays the first data summaries without a file-not-found error.

A complete first data exploration

Create a Python project that loads, inspects, cleans and summarizes customer data. You will understand what the dataset contains before using it for Ai.

CSV datapandasData qualitySummary statisticsFilteringChart
Creating a Python projectLoading CSV dataUnderstanding rows and columnsChecking data typesFinding missing valuesRemoving duplicatesCalculating summariesFiltering and groupingCreating a chart
LevelBeginner
CodingBasic Python
Time60–90 minutes
SoftwarePython, VS Code and Jupyter or .py
Librariespandas + matplotlib

Explore the customer dataset

Run each code block, confirm its output, then mark the step complete.

Step 01

Install the packages

Prepare pandas for data work and matplotlib for the chart.

VS Code terminal
pip install pandas matplotlib
requirements.txt
pandas
matplotlib
Step 02

Load the dataset

Read the CSV file and handle a missing-file error clearly.

Python
import pandas as pd

file_path = "data/customer-data.csv"

try:
    df = pd.read_csv(file_path)
    print("Dataset loaded successfully.")
except FileNotFoundError:
    print(f"Dataset not found: {file_path}")
Expected result

Dataset loaded successfully.

Step 03

Inspect the data

Understand its size, columns, values and data types.

Python
print(df.head())
print(df.shape)
print(df.columns)
df.info()
Step 04

Check data quality

Find missing values and duplicates before changing the data.

Check quality
print("Missing values:")
print(df.isnull().sum())

print("\nDuplicate rows:")
print(df.duplicated().sum())
Clean the data
df = df.drop_duplicates()

df["Monthly Spending"] = df["Monthly Spending"].fillna(
    df["Monthly Spending"].median()
)
Important

Replace each column name with the exact name used in your dataset. Check why a row is duplicated before removing it.

Step 05

Summarize the dataset

Calculate useful numerical and category summaries.

Python
print(df.describe())

average_spending = df["Monthly Spending"].mean()
average_purchases = df["Number of Purchases"].mean()

print("Average monthly spending:", round(average_spending, 2))
print("Average number of purchases:", round(average_purchases, 2))
print(df["Membership Type"].value_counts())
Step 06

Filter and group the data

Find high-spending customers and compare membership groups.

Python
high_spending_customers = df[df["Monthly Spending"] > 100]
print(high_spending_customers.head())

membership_summary = (
    df.groupby("Membership Type")["Monthly Spending"]
    .mean()
    .sort_values(ascending=False)
)

print(membership_summary)
Step 07

Create a simple chart

Visualise average spending across membership groups.

Python
import matplotlib.pyplot as plt

membership_summary.plot(kind="bar")

plt.title("Average Spending by Membership Type")
plt.xlabel("Membership Type")
plt.ylabel("Average Monthly Spending")
plt.tight_layout()
plt.show()
Expected result

A bar chart comparing average spending across membership groups.

Complete your project evidence

Cleaned datasetPython notebook or scriptData summaryOne chartThree findingsREADME file

Write three important findings

Responsible data check

Confirm your Data Explorer

Portfolio explanation

I created a Python Data Explorer using pandas. I loaded and inspected a customer dataset, checked data types, handled missing values, removed duplicates, calculated summary statistics and created a chart comparing customer groups. This project developed my basic Python, data-cleaning and exploratory-analysis skills.

Next project

Project 03 — Rule-Based Learning Path Recommender

Turn clear human-defined rules into a working recommendation system.

Start Project 03