Epsilon AI Learning
Ask AI
العربية
Enroll

Level 1 · Professional · CPDAP

Certified Python Data Analyst Professional

The Python-analyst path: everything in CDSP except machine learning — Python, SQL, statistics, EDA, visualization, and preprocessing.

84 hours 9 lessons Leads to: CDSP
Your progress 0 / 9

01Foundations

AI & Data Science Foundations

Before any code: what data science actually is, how AI / ML / DL relate, and the workflow every project follows.

8 min read

The big picture

Artificial Intelligence (AI) is the broad goal of making machines do things that normally need human intelligence. Machine Learning (ML) is the main way we reach that goal today: instead of writing rules by hand, we let a program learn patterns from data. Deep Learning (DL) is a powerful branch of ML that uses neural networks with many layers. Data Science is the wider craft of turning raw data into decisions — it uses statistics, programming, and ML together.

Three kinds of machine learning

  • Supervised learning — you have labeled examples (input → known answer) and the model learns to predict the answer. E.g. predict a house price from its features.
  • Unsupervised learning — no labels; the model finds structure on its own, such as grouping similar customers (clustering).
  • Reinforcement learning — an agent learns by trial and reward, like a program learning to play a game.

The data-science workflow

Almost every project follows the same loop. Knowing it keeps you oriented no matter how complex the problem gets:

  • 1. Define the question and success metric with stakeholders.
  • 2. Collect and store the data (files, databases, APIs).
  • 3. Clean and explore it (EDA) — understand what you actually have.
  • 4. Prepare features and split into train/test sets.
  • 5. Train models, evaluate, and tune them.
  • 6. Deploy the chosen model and monitor it in production.
Test yourself A bank wants to flag which transactions are fraud, using millions of past transactions already labeled fraud / not-fraud. Which kind of ML is this?

Supervised learning (specifically binary classification) — the historical labels are the supervision signal the model learns to reproduce.

Where the tools fit

In this program you will use Python as the language, SQL to pull data from databases, NumPy/Pandas to explore it, Matplotlib/Plotly to visualize it, scikit-learn to build models, and Streamlit to ship them. Each later topic in this guide is one stop on that path.

Key takeaways

  • AI ⊃ ML ⊃ DL; data science wraps statistics, code and ML around a business question.
  • Supervised = labeled data; unsupervised = find structure; reinforcement = learn by reward.
  • Every project follows the same loop: question → data → EDA → features → model → deploy.

02Programming

Python Programming

Python is the language of data science because it is readable and has a library for everything. Master a small core and you can do 90% of the work.

12 min read

Why Python

Python reads almost like English, runs everywhere, and has the richest data ecosystem (NumPy, Pandas, scikit-learn, TensorFlow). You do not need to be a software engineer — you need fluency in a focused set of building blocks.

Variables and core data types

A variable is a name that points to a value. Python figures out the type for you. The everyday types are numbers (int, float), text (str), booleans (True/False), and the containers below.

The four containers you use constantly
price = 250.0            # float
name  = "Cairo villa"    # str
is_sold = False          # bool

nums   = [1, 2, 3, 4]                 # list  — ordered, changeable
point  = (30.0, 31.2)                 # tuple — ordered, fixed
unique = {"cat", "dog"}               # set   — no duplicates
person = {"name": "Sara", "age": 29}  # dict  — key → value

Control flow: decisions and loops

if/elif/else choose between paths; for loops repeat over a collection. Indentation (4 spaces) is how Python groups code — there are no braces.

python
for n in nums:
    if n % 2 == 0:
        print(n, "is even")
    else:
        print(n, "is odd")

Functions — package logic you reuse

A function takes inputs, does work, and returns a result. Writing functions keeps analysis clean and repeatable instead of copy-pasting code.

python
def price_per_m2(price, area):
    """Return price per square meter."""
    return price / area

print(price_per_m2(250000, 120))   # 2083.33
Test yourself What does list[0] give you, and why can list[-1] be handy?

list[0] is the first element (Python counts from 0). list[-1] is the last element — negative indexes count from the end, so you get the last item without knowing the length.

List comprehensions & libraries

A list comprehension builds a new list in one readable line — a Python idiom you will see everywhere. And `import` brings in libraries: this is how NumPy and Pandas (next topics) enter your notebook.

python
squares = [n * n for n in range(5)]   # [0, 1, 4, 9, 16]

import pandas as pd
df = pd.read_csv("sales.csv")         # your data, one line away

Key takeaways

  • Four containers — list, tuple, set, dict — cover most data structures you need.
  • Indentation defines blocks; functions make analysis reusable.
  • import is the gateway to the whole data ecosystem (Pandas, NumPy, scikit-learn).

03Data

Databases & SQL

Most real data lives in databases. SQL is the universal language for asking questions of that data — and it is mostly one verb: SELECT.

11 min read

Tables, rows, columns

A relational database stores data in tables — a grid of rows (records) and columns (fields). Each table usually has a primary key that uniquely identifies a row, and tables relate to each other through those keys. MySQL is the engine you will use.

The anatomy of a query

Reading data is one statement whose clauses always run in a fixed logical order. Learn this skeleton and you can read almost any query.

SELECT … FROM … WHERE … GROUP BY … ORDER BY
SELECT   city, COUNT(*) AS deals, AVG(price) AS avg_price
FROM     sales
WHERE    year = 2025
GROUP BY city
HAVING   COUNT(*) > 10
ORDER BY avg_price DESC
LIMIT    5;

JOINs — combining tables

Data you need is usually spread across tables (customers, orders, products). A JOIN stitches them back together on a shared key. INNER JOIN keeps only matches; LEFT JOIN keeps every row from the left table even when the right has no match.

sql
SELECT o.id, c.name, o.total
FROM   orders o
JOIN   customers c ON c.id = o.customer_id
WHERE  o.total > 1000;
Test yourself You LEFT JOIN customers to orders and some order columns come back NULL. What does that mean?

Those customers have no matching orders. LEFT JOIN kept them anyway and filled the missing right-side columns with NULL — a common way to find customers who never ordered.

Aggregation is where insight lives

  • COUNT, SUM, AVG, MIN, MAX summarize many rows into one number.
  • GROUP BY computes those summaries per category (per city, per month).
  • This single pattern answers most business questions: 'what is the average/total X per Y?'

Key takeaways

  • SELECT/FROM/WHERE/GROUP BY/ORDER BY is the skeleton of nearly every query.
  • JOINs recombine normalized tables on shared keys; LEFT JOIN preserves unmatched rows.
  • GROUP BY + an aggregate answers most 'X per Y' business questions.

04Math & Statistics

Statistics & Probability

Statistics is how you tell signal from noise: describe what happened, then judge whether a pattern is real or just luck.

13 min read

Descriptive statistics: center and spread

First, summarize a column. The center is the mean (average) or median (middle value — robust to outliers). The spread is the standard deviation: small means values hug the mean; large means they scatter. Always look at both — the same mean can hide very different data.

Distributions & the normal curve

A distribution shows how often each value occurs. The famous normal (bell) curve appears everywhere. Its rule of thumb: about 68% of values fall within 1 standard deviation of the mean, 95% within 2, and 99.7% within 3. That is how you judge whether a value is 'unusual'.

Probability in one minute

  • Probability measures how likely an event is, from 0 (never) to 1 (certain).
  • Conditional probability P(A|B) — the chance of A given B already happened — is the heart of many models (e.g. spam filters).
  • Independent events multiply: P(A and B) = P(A)·P(B) when one does not affect the other.

Inference: is this pattern real?

You rarely have all the data — only a sample. Inferential statistics lets you generalize from the sample to the population. A hypothesis test asks: 'if there were truly no effect, how surprising is what I saw?' The p-value answers it: a small p-value (< 0.05 by convention) means the result is unlikely to be pure chance.

Test yourself A p-value of 0.60 — does that prove your two groups are the same?

No. A large p-value means you failed to find strong evidence of a difference — not that there is none. 'No evidence of a difference' is not 'evidence of no difference'.

Correlation ≠ causation

Correlation measures how two variables move together (from -1 to +1). It is essential for feature selection — but two things can correlate without one causing the other (ice-cream sales and drownings both rise in summer). Proving causation needs a controlled experiment, not just a correlation.

Models & techniques — what, when & why

Mean vs. Median Descriptive

Two measures of the 'center' of a column: the mean is the average; the median is the middle value.

Use the median for skewed data (income, prices); the mean for roughly symmetric data.

The median resists outliers — a few extreme values don't drag it, so it stays 'typical'.

Example: Salaries 30k,32k,35k,900k → mean ≈ 249k (misleading), median = 33.5k (honest).

Standard Deviation Spread

Measures how far values typically sit from the mean — the 'spread' of the data.

Report it alongside the mean to describe any numeric column, and to spot unusual values.

Two datasets can share a mean but differ wildly; SD reveals that difference in one number.

Example: Under a normal curve, ~95% of values fall within 2 SD of the mean.

Hypothesis Test (p-value) Inferential

Asks whether an observed effect is likely real or could be pure chance, summarized by a p-value.

Comparing groups (A/B tests), checking if a difference or relationship is significant.

It quantifies surprise: a small p (< 0.05) means the result is unlikely under 'no effect'.

Example: New page's higher sign-ups with p = 0.01 → likely a real improvement, not luck.

Correlation Relationship

Measures how two numeric variables move together, from -1 (opposite) to +1 (together).

Feature selection and early exploration — which inputs relate to your target.

Fast to compute and interpret — but never proves causation; a third factor may drive both.

Example: Area correlates +0.8 with price → useful feature; ice-cream vs. drownings → both driven by heat.

Key takeaways

  • Report center and spread together; prefer the median for skewed data.
  • The normal curve's 68/95/99.7 rule tells you what counts as unusual.
  • A small p-value means 'probably not chance'; correlation never proves causation.
Try it The normal distribution

Most data clusters around a mean and spreads by a standard deviation. Move μ to shift the centre and σ to widen or tighten the bell — the shaded band is ±1σ (~68% of the data).

±1σ ≈ 68% · ±2σ ≈ 95%

05Math & Statistics

Math for Machine Learning

You do not need heavy math to start, but two ideas power everything: vectors/matrices (how data is stored) and derivatives (how models learn).

11 min read

Vectors and matrices = your data

A single example (one house: its size, rooms, age) is a vector — a list of numbers. Stack many examples and you get a matrix: rows are examples, columns are features. Every dataset you load into Pandas is, underneath, a matrix — which is why linear algebra is the language of ML.

The dot product — the workhorse

Multiply two vectors element-by-element and add the results: that single operation is how a model combines features with weights to make a prediction. A linear model is literally weights · features + bias.

python
import numpy as np
weights  = np.array([0.4, 0.3, -0.1])
features = np.array([120, 3, 15])       # size, rooms, age
prediction = weights @ features + 50    # @ is the dot product
# 0.4*120 + 0.3*3 + -0.1*15 + 50 = 97.4

Derivatives = the direction of improvement

A derivative measures how a function changes as you nudge its input — its slope. In ML, the function is the error, and the derivative (gradient) points uphill toward more error. So we step the opposite way to reduce it. That is gradient descent: the single algorithm behind training linear models, neural networks, and most of deep learning.

Test yourself If the learning rate (step size) is far too large, what goes wrong?

You overshoot the minimum and bounce around — the error can oscillate or even blow up instead of settling. Too small and it crawls. Tuning the learning rate is a core skill.

Key takeaways

  • Data is vectors and matrices; a prediction is a dot product of weights and features.
  • Derivatives give the slope of the error; gradient descent steps downhill to learn.
  • The learning rate controls step size — too big overshoots, too small crawls.

06Data

Exploratory Data Analysis

Before modeling, you interrogate the data: its shape, its gaps, its outliers. Pandas is the tool; curiosity is the method.

12 min read

NumPy and Pandas

NumPy gives you fast numerical arrays; Pandas builds the DataFrame on top — a labeled table (like a spreadsheet in code) that is the center of gravity of all analysis in Python. You load data into a DataFrame and every later step operates on it.

First five moves on any dataset

These five lines answer: how big is it, what do the columns mean, what types are they, and where are the holes. You never model data you have not first looked at this way.

The reflex you run before anything else
df.shape         # (rows, columns) — how big is it?
df.head()        # eyeball the first rows
df.info()        # column types + non-null counts
df.describe()    # mean/std/min/quartiles for numbers
df.isna().sum()  # how many missing values per column

Select, filter, group

The three verbs you use constantly: pick columns/rows, keep rows that meet a condition, and summarize by category. The groupby pattern mirrors SQL's GROUP BY.

python
df[["city", "price"]]                       # select columns
df[df["price"] > 1_000_000]                 # filter rows
df.groupby("city")["price"].mean()          # summarize per city

Missing values and outliers

  • Missing data: decide per column — drop the rows, or fill (impute) with the mean/median/mode, or a domain value. Never ignore it silently.
  • Outliers: values far from the rest. Sometimes errors to fix, sometimes the most interesting signal (fraud!). Investigate before deleting.
  • A boxplot or the IQR rule (1.5 × interquartile range) is the standard way to flag them.
Test yourself A 'salary' column has a few values of 0 and one of 9,999,999. Impute the mean into all of them?

No — investigate first. The 0s are likely missing-data placeholders and the huge value is probably an entry error or an outlier. Imputing the mean blindly would poison the analysis. Understand the cause, then decide per case.

Key takeaways

  • The DataFrame is the center of analysis; shape/head/info/describe/isna is your opening move.
  • Select, filter, and groupby handle most day-to-day exploration.
  • Handle missing values and outliers deliberately — investigate before you delete or impute.
The idea Exploratory Data Analysis (EDA)

Before modelling, you explore: plot distributions, spot outliers, and find relationships between variables — letting the data tell you what matters.

Practice this in the interactive lab

07Data

Data Visualization

A chart reveals in a second what a table hides in a thousand rows. The skill is picking the right chart for the question.

9 min read

Match the chart to the question

  • Comparison across categories → bar chart.
  • Trend over time → line chart.
  • Relationship between two numbers → scatter plot.
  • Distribution of one number → histogram or boxplot.
  • Part of a whole → stacked bar (avoid pie charts beyond a few slices).

The tools

Matplotlib is the foundation (full control), Seaborn adds beautiful statistical charts in one line, and Plotly makes interactive charts you can hover and zoom. Streamlit then turns your script into a shareable web app — no web development needed.

python
import plotly.express as px
fig = px.scatter(df, x="area", y="price", color="city",
                 title="Price vs. area")
fig.show()

Make it honest and clear

A good chart has a clear title, labeled axes, and starts the y-axis at zero for bar charts (truncating it exaggerates differences). Remove clutter; highlight the one thing the reader should see. A visualization is an argument — make it a fair one.

Test yourself You want to show how monthly revenue changed over two years. Bar or line?

Line chart — it is a trend over time, and a line makes the rise/fall and seasonality easy to read across 24 points where 24 bars would feel cluttered.

Models & techniques — what, when & why

Bar Chart Comparison

Compares a value across categories using rectangle length.

Comparing discrete groups: sales per region, count per class.

Length is the easiest visual channel to compare accurately.

Example: Revenue by city — start the axis at zero to stay honest.

Line Chart Trend over time

Connects points in order to show how a value changes over a continuous axis (usually time).

Trends, growth, and seasonality across many time points.

The slope makes rises, falls and cycles instantly readable.

Example: Monthly revenue over two years reads far better as a line than 24 bars.

Scatter Plot Relationship

Places each row as a point in x–y space to show how two numbers relate.

Exploring correlation, clusters, and outliers between two variables.

Reveals patterns (linear, curved, grouped) a summary statistic would hide.

Example: Area vs. price with color by city shows both the trend and segment differences.

Histogram / Boxplot Distribution

Show the distribution of a single numeric column — its shape, center, spread and outliers.

Before modeling, to understand a variable and detect skew or anomalies.

A mean alone hides the shape; these expose it (bimodal, skewed, heavy tails).

Example: A boxplot flags salary outliers via the 1.5×IQR rule.

Key takeaways

  • Chart choice follows the question: compare→bar, time→line, relate→scatter, distribute→histogram.
  • Matplotlib/Seaborn/Plotly to draw; Streamlit to ship it as an app.
  • Label axes, avoid misleading scales — a chart is an argument, keep it fair.

08Data

Data Preprocessing & Feature Engineering

Models are only as good as the features you feed them. Preprocessing is turning messy raw data into clean, model-ready numbers — often where projects are won.

11 min read

Why models need clean features

Algorithms only understand numbers, and many assume features are on similar scales and free of gaps. Real data is text, categories, missing cells, and wildly different ranges. Preprocessing bridges that gap — 'garbage in, garbage out' is the iron law here.

Encoding categories

Turn text categories into numbers. One-hot encoding makes a 0/1 column per category (best for unordered categories like city). Label/ordinal encoding assigns an order (good for 'small < medium < large').

Scaling numeric features

If 'age' (0–100) and 'income' (0–1,000,000) sit together, distance-based models think income is 10,000× more important just because of its scale. Standardization (subtract mean, divide by std) or min-max scaling (squeeze to 0–1) puts features on equal footing.

Feature engineering: the creative edge

The highest-value step: create new features that expose the signal. From a date, derive day-of-week or is-holiday; from price and area, derive price-per-m². A well-engineered feature can beat a fancier model on raw inputs.

Test yourself Why scale features on the training set and reuse that scaler on the test set, rather than scaling all data at once?

Because the test set must simulate unseen future data. If the scaler 'saw' the test set's mean/range, information leaks from test into training and your evaluation becomes over-optimistic — the model looks better than it will be in production.

Models & techniques — what, when & why

One-Hot Encoding Categorical

Turns an unordered category into one 0/1 column per possible value.

Categories with no natural order (city, color, brand).

Avoids inventing a false ranking that a plain number code would imply.

Example: city → is_cairo, is_giza, is_alex columns.

Standardization / Scaling Numeric

Rescales numeric features to a comparable range (mean 0/SD 1, or 0–1).

For distance- and gradient-based models (kNN, SVM, neural nets, k-means).

Stops a large-range feature (income) from dominating a small one (age) by scale alone.

Example: Fit the scaler on train only, then apply to test — avoid data leakage.

Feature Engineering Creation

Creates new, more informative inputs from existing columns.

Whenever domain knowledge suggests a better signal than the raw fields.

A well-chosen feature often beats a fancier model on raw inputs.

Example: From date → day-of-week, is_holiday; from price & area → price_per_m².

Imputation Missing data

Fills missing cells with a sensible value (mean, median, mode, or a domain default).

When dropping rows would lose too much data and the gaps aren't meaningful.

Most models can't accept NULLs; thoughtful imputation preserves signal.

Example: Impute median for skewed numeric columns; investigate 0-as-missing first.

Key takeaways

  • Encode categories (one-hot / ordinal) and scale numeric features to comparable ranges.
  • Fit transformers on train only, apply to test — avoid data leakage.
  • Feature engineering — inventing informative features — is often the biggest lever on accuracy.
The idea Data preprocessing

Raw data is messy — missing values, different scales, text categories. Preprocessing cleans, fills, encodes, and scales it into a tidy matrix a model can learn from.

Practice this in the interactive lab

09Engineering

Model Deployment

A model in a notebook helps no one. Deployment is turning it into something people (or other software) can actually use.

9 min read

Save the model, not just the notebook

Training and serving are separate. Once trained, you serialize the model to a file (joblib/pickle) so any program can load it and predict without retraining. This artifact is what you deploy.

python
import joblib
joblib.dump(model, "model.joblib")     # after training
# later, in the app:
model = joblib.load("model.joblib")
model.predict(new_data)

Two ways to serve it

  • A web app (Streamlit) — a UI where users type inputs and see predictions. Fastest way to demo value.
  • An API (Flask/FastAPI) — an endpoint other software calls to get predictions programmatically. This is how models plug into real products.

It does not end at launch

The world changes, so a live model's accuracy drifts over time (data drift). Production ML means monitoring predictions, retraining on fresh data, and versioning models — the discipline called MLOps, which the advanced program covers in depth.

Test yourself Your model was 92% accurate at launch; six months later it is 78%. The code never changed. What likely happened?

Data drift — the real-world data has shifted away from what the model trained on (new trends, prices, behavior). The fix is monitoring plus periodic retraining on recent data.

Key takeaways

  • Serialize the trained model to a file; serving is separate from training.
  • Serve via a Streamlit app (for people) or a Flask/FastAPI endpoint (for software).
  • Monitor for data drift and retrain — deployment is a lifecycle, not a one-off.

Prerequisite lessons on video

Data Science Diploma — Prerequisites Watch on YouTube

Type to search across Epsilon.

navigate open esc close Open full search →

Get this download

Enter your details and we'll email you the download link right away.

We'll email the link to you — no spam.
WhatsApp Call Enroll