DOCODIVE
Beginner Free Learning Path

Data Science Beginner Course

Learn how to turn raw data into decisions. Master Python, NumPy, Pandas, data cleaning, statistics, and visualization — then apply it all in a real dataset capstone project.

4–6 weeks 20 lessons 1 capstone No experience required
Start Learning
01

What Is Data Science?

12 min
What you'll learn
  • Understand the data science workflow
  • Learn why data drives decisions
  • See real-world applications

Data science is the art of turning raw data into decisions. The workflow is: ask a question, collect data, clean it, explore it, model it, and communicate insights. Every recommendation you see — Netflix suggestions, Amazon product picks, Spotify playlists — is data science in action. In this course you'll learn the same Python tools professionals use every day.

workflow.py
# The data science workflow
workflow = [
    'Ask', 'Collect', 'Clean',
    'Explore', 'Model', 'Communicate'
]
print(' → '.join(workflow))
Output
python
Ask → Collect → Clean → Explore → Model → Communicate
💡 Tip: Data science is 80% cleaning data and 20% fancy algorithms — master the 'boring' parts first.
Try it yourself

List three industries where data science is used daily.

Think about apps you already use.
E-commerce, healthcare, finance, social media, transport.
02

Setting Up Python for Data Science

14 min
What you'll learn
  • Install NumPy, Pandas, Matplotlib
  • Understand Jupyter notebooks
  • Import libraries correctly

Python's data science power comes from its ecosystem: NumPy for numbers, Pandas for tables, Matplotlib for charts. The standard way to import them is with short aliases — np, pd, plt — that you'll see in every tutorial and codebase. Jupyter Notebook is the interactive environment where data scientists experiment, but plain .py files work too.

setup.py
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

print('NumPy', np.__version__)
print('Pandas', pd.__version__)
Output
python
NumPy 1.26.4 Pandas 2.2.2
✓ Best Practice: Always use the standard aliases (np, pd, plt) — it's a universal convention.
Try it yourself

Import pandas with the standard alias and print its version.

import pandas as pd; pd.__version__
import pandas as pd
print(pd.__version__)
03

NumPy Arrays: The Foundation

18 min
What you'll learn
  • Create NumPy arrays
  • Understand vectorized operations
  • Reshape and slice arrays

NumPy arrays are like Python lists but far more powerful — they're fast, memory-efficient, and support vectorized operations that work on entire arrays at once. Instead of looping through a million numbers, you write one operation that applies to all of them simultaneously. This speed is why every data science library is built on NumPy.

numpy.py
import numpy as np

arr = np.array([1, 2, 3, 4, 5])
print('Array:', arr)
print('Doubled:', arr * 2)
print('Mean:', arr.mean())
print('Shape:', arr.shape)
Live Preview
NumPy Arrays: The Foundation
1
2
3
4
5
🔎 Important: Vectorized arr * 2 runs in C speed underneath — never loop over NumPy arrays element by element.
Try it yourself

Create an array of [10,20,30] and add 5 to every element.

np.array([10,20,30]) + 5
arr = np.array([10, 20, 30])
arr + 5  # [15, 25, 35]
04

Pandas Series

14 min
What you'll learn
  • Create Series objects
  • Access values by index
  • Perform quick statistics

A Pandas Series is a one-dimensional labeled array — think of a column in a spreadsheet. Each value has an index label. You can create one from a list, give it custom labels, and instantly compute statistics like sum, mean, min, and max. Series is the building block for DataFrames, the main data structure you'll use from here on.

series.py
import pandas as pd

temps = pd.Series([22, 25, 19, 30, 27],
                 index=['Mon','Tue','Wed','Thu','Fri'])
print(temps)
print('Average:', temps.mean())
print('Hottest:', temps.max())
Live Preview
Pandas Series
name
age
city
Ali
25
Lahore
Sara
30
Karachi
Omar
22
Islamabad
💡 Tip: Custom index labels make data readable — like row names in a spreadsheet.
Try it yourself

Create a Series of [1,2,3] with index ['a','b','c'].

pd.Series([1,2,3], index=['a','b','c'])
s = pd.Series([1, 2, 3], index=['a', 'b', 'c'])
print(s)
05

Pandas DataFrames

18 min
What you'll learn
  • Create DataFrames from dicts
  • Select rows and columns
  • Understand shape and info

A DataFrame is a two-dimensional table — rows and columns, exactly like Excel or a SQL table. You build one from a dictionary where each key becomes a column. It's THE core data structure in data science: load data into a DataFrame, and you can filter, sort, group, aggregate, and visualize with a few lines of code.

dataframe.py
import pandas as pd

data = {
    'name': ['Ali', 'Sara', 'Omar'],
    'age': [25, 30, 22],
    'city': ['Lahore', 'Karachi', 'Islamabad']
}
df = pd.DataFrame(data)
print(df)
print('Shape:', df.shape)
print(df['name'])
Live Preview
Pandas DataFrames
name
age
city
Ali
25
Lahore
Sara
30
Karachi
Omar
22
Islamabad
🔎 Important: df.shape tells you (rows, columns) instantly — your first check on any new dataset.
Try it yourself

Create a DataFrame with columns 'fruit' and 'price' (3 rows).

pd.DataFrame({'fruit':[...], 'price':[...]})
df = pd.DataFrame({'fruit':['apple','banana','mango'], 'price':[2,1,3]})
06

Reading CSV Files

16 min
What you'll learn
  • Load data with read_csv
  • Inspect data with head()
  • Check missing values

CSV (comma-separated values) is the universal data exchange format — every dataset you download from Kaggle or government portals is likely a CSV. pd.read_csv() loads it into a DataFrame in one line. Then head() shows the first rows, info() shows the schema, and isnull().sum() reveals missing data. This is the first thing you do with any real dataset.

csv.py
import pandas as pd

df = pd.read_csv('sales.csv')
print(df.head())
print(df.info())
print('Missing:', df.isnull().sum())
Live Preview
Reading CSV Files
name
age
city
Ali
25
Lahore
Sara
30
Karachi
Omar
22
Islamabad
✓ Best Practice: The read_csv → head → info → isnull sequence is your starting ritual for every dataset.
Try it yourself

Load a CSV and print its first 3 rows.

df.head(3)
df = pd.read_csv('data.csv')
print(df.head(3))
07

Data Cleaning Basics

20 min
What you'll learn
  • Handle duplicates
  • Fix data types
  • Rename columns

Real data is messy — duplicate rows, wrong types, cryptic column names. Cleaning is removing duplicates with drop_duplicates(), converting types with astype(), and renaming columns with rename(). It's unglamorous, but clean data is the difference between reliable analysis and garbage results. This is where data scientists spend most of their time.

cleaning.py
import pandas as pd

df = pd.DataFrame({'Name':['Ali','Ali','Sara'],
                   'Age':['25','30','22']})
df = df.drop_duplicates()
df['Age'] = df['Age'].astype(int)
df = df.rename(columns={'Name':'full_name'})
print(df)
Live Preview
Data Cleaning Basics
name
age
city
Ali
25
Lahore
Sara
30
Karachi
Omar
22
Islamabad
🔎 Important: Always clean BEFORE analyzing — duplicates silently inflate counts and skew results.
Try it yourself

Drop duplicate rows from a DataFrame.

df.drop_duplicates()
df = df.drop_duplicates()
08

Handling Missing Values

20 min
What you'll learn
  • Detect missing data
  • Drop or fill missing values
  • Understand the trade-offs

Missing values (NaN) are everywhere in real data. You either drop rows with dropna() or fill them with fillna() — using a mean, median, or a placeholder. Dropping loses data; filling can introduce bias. The right choice depends on context: a missing phone number is fine to drop; a missing salary might need careful imputation.

missing.py
import pandas as pd
import numpy as np

df = pd.DataFrame({'score':[85, np.nan, 92, np.nan, 78]})
print('Original mean:', df['score'].mean())
df_filled = df.fillna(df['score'].mean())
print(df_filled)
Live Preview
Handling Missing Values
name
age
city
Ali
25
Lahore
Sara
30
Karachi
Omar
22
Islamabad
⚠️ Common Mistake: Filling with the mean is common but can hide real patterns — always question your imputation choice.
Try it yourself

Fill missing values with 0.

df.fillna(0)
df = df.fillna(0)
09

Data Visualization with Matplotlib

20 min
What you'll learn
  • Create line and bar charts
  • Add titles and labels
  • Customize plots

Matplotlib is Python's foundational plotting library. A simple line or bar chart turns numbers into insights you can see instantly. The pattern is: create a figure, plot your data, add labels, and show it. Every other visualization library builds on this foundation, so understanding Matplotlib unlocks everything else.

viz.py
import matplotlib.pyplot as plt

months = ['Jan', 'Feb', 'Mar', 'Apr']
sales = [120, 150, 130, 170]

plt.bar(months, sales, color='#059669')
plt.title('Monthly Sales')
plt.xlabel('Month')
plt.ylabel('Sales')
plt.show()
Live Preview
Data Visualization with Matplotlib
Jan
Feb
Mar
Apr
💡 Tip: Always label your axes — an unlabeled chart is meaningless to everyone but you.
Try it yourself

Create a line plot of [1,3,2,4].

plt.plot([1,3,2,4])
plt.plot([1, 3, 2, 4])
plt.show()
10

More Charts: Histograms & Pie

18 min
What you'll learn
  • Visualize distributions with histograms
  • Show proportions with pie charts
  • Pick the right chart

Choosing the right chart matters. Histograms show how values are distributed — where most data clusters, whether it's skewed. Pie charts show proportions of a whole. Bar charts compare categories. The skill is knowing which question each chart answers and reaching for the right one.

hist.py
import matplotlib.pyplot as plt
import numpy as np

np.random.seed(42)
scores = np.random.normal(70, 10, 1000)
plt.hist(scores, bins=20, color='#059669', edgecolor='white')
plt.title('Score Distribution')
plt.xlabel('Score')
plt.ylabel('Frequency')
plt.show()
Live Preview
More Charts: Histograms & Pie
✓ Best Practice: Histograms reveal the SHAPE of data — normal, skewed, bimodal — in one glance.
Try it yourself

Create a histogram of [1,1,2,3,3,3,4].

plt.hist([...])
plt.hist([1,1,2,3,3,3,4])
plt.show()
11

Introduction to Statistics

18 min
What you'll learn
  • Understand descriptive statistics
  • Learn population vs sample
  • Grasp why statistics matters

Statistics is the math behind data science — how we summarize, infer, and make decisions from data. Descriptive statistics (mean, median, spread) describe what you have; inferential statistics helps you generalize to what you don't. Without statistics, data science is just guessing with extra steps.

stats.py
import numpy as np

data = [10, 12, 15, 18, 20, 20, 25]
print('Mean:', np.mean(data))
print('Median:', np.median(data))
print('Std:', np.std(data))
print('Range:', max(data) - min(data))
Live Preview
Introduction to Statistics
17.1
Mean
18.0
Median
4.8
Std
🔎 Important: Mean and median tell different stories — median is robust to outliers, mean is not.
Try it yourself

Compute the median of [1,2,3,4,100].

np.median(...)
np.median([1,2,3,4,100])  # 3
12

Mean, Median & Mode

16 min
What you'll learn
  • Calculate central tendency
  • Choose the right metric
  • Detect skewness

Central tendency tells you the 'typical' value. Mean is the average (sensitive to outliers). Median is the middle value (robust). Mode is the most frequent. In skewed data — like income, where a few billionaires inflate the average — the median is usually more honest than the mean.

central.py
import numpy as np
from scipy import stats

income = [30000, 32000, 35000, 38000, 40000, 1000000]
print('Mean:', np.mean(income))
print('Median:', np.median(income))
print('Mode:', stats.mode(income).mode)
Live Preview
Mean, Median & Mode
17.1
Mean
18.0
Median
4.8
Std
⚠️ Common Mistake: One millionaire made the mean 5x the median — this is why median is preferred for income data.
Try it yourself

Why is median better than mean for house prices?

Think about outlier mansions.
A few luxury homes inflate the mean; median reflects the typical home.
13

Data Distribution & Outliers

18 min
What you'll learn
  • Identify normal vs skewed data
  • Detect outliers
  • Understand standard deviation

Distribution describes how data spreads out. Normal distribution is the bell curve — symmetric, most values near the middle. Skewed data leans left or right. Outliers sit far from the rest and can distort analysis. Standard deviation measures spread: low means tight clustering, high means wide scatter.

outliers.py
import numpy as np

data = [10, 12, 11, 13, 12, 11, 100]  # 100 is an outlier
mean = np.mean(data)
std = np.std(data)
outlier_threshold = mean + 2 * std
outliers = [x for x in data if x > outlier_threshold]
print('Outliers:', outliers)
Live Preview
Data Distribution & Outliers
17.1
Mean
18.0
Median
4.8
Std
🔎 Important: A common outlier rule: values beyond mean ± 2 standard deviations are worth investigating.
Try it yourself

Find the outlier in [1,2,2,3,50].

It's the value far from the rest.
50 is the outlier.
14

Correlation

18 min
What you'll learn
  • Understand correlation coefficient
  • Distinguish correlation from causation
  • Interpret r values

Correlation measures how two variables move together, scored from -1 to +1. +1 means perfectly together, -1 means opposite, 0 means no relationship. But correlation is NOT causation: ice cream sales and drowning both rise in summer, but ice cream doesn't cause drowning — a third variable (heat) drives both.

correlation.py
import pandas as pd

df = pd.DataFrame({
    'hours_studied': [1, 2, 3, 4, 5],
    'exam_score': [50, 58, 70, 82, 90]
})
print(df.corr())
Live Preview
Correlation
0.99

Strong positive correlation

🔎 Important: 0.99 correlation is strong — but always ask: is there a hidden third variable?
Try it yourself

What does a correlation of -0.9 mean?

Negative means opposite movement.
As one variable increases, the other decreases strongly.
15

Data Wrangling: Filter & Sort

20 min
What you'll learn
  • Filter rows with conditions
  • Sort by columns
  • Select specific columns

Wrangling is shaping data into the form you need. Filtering keeps rows meeting a condition (sales > 100). Sorting orders rows by a column. Selecting grabs specific columns. These three operations — filter, sort, select — are the daily bread of data work, and Pandas makes each a one-liner.

wrangling.py
import pandas as pd

df = pd.DataFrame({
    'product': ['A','B','C','D'],
    'sales': [120, 80, 200, 150],
    'region': ['East','West','East','South']
})
high = df[df['sales'] > 100]
sorted_df = df.sort_values('sales', ascending=False)
print(high)
print(sorted_df[['product','sales']])
Live Preview
Data Wrangling: Filter & Sort
name
age
city
Ali
25
Lahore
Sara
30
Karachi
Omar
22
Islamabad
💡 Tip: Boolean indexing (df[df['sales'] > 100]) is the Pandas superpower — master it early.
Try it yourself

Filter rows where age > 25 from a DataFrame.

df[df['age'] > 25]
adults = df[df['age'] > 25]
16

Grouping & Aggregation

20 min
What you'll learn
  • Group data by categories
  • Apply aggregations like sum/mean
  • Create summary tables

Grouping splits data by category, then aggregates each group — average salary by department, total sales by region, max temperature by month. The pattern df.groupby('column').agg(...) is how you turn thousands of raw rows into a compact, meaningful summary. It's arguably the most important Pandas operation for real analysis.

groupby.py
import pandas as pd

df = pd.DataFrame({
    'region': ['East','West','East','West'],
    'sales': [100, 150, 200, 120]
})
summary = df.groupby('region').agg(
    total=('sales', 'sum'),
    average=('sales', 'mean')
)
print(summary)
Live Preview
Grouping & Aggregation
name
age
city
Ali
25
Lahore
Sara
30
Karachi
Omar
22
Islamabad
✓ Best Practice: groupby + agg collapses rows into insights — the heart of every business report.
Try it yourself

Group by 'department' and sum 'salary'.

df.groupby('department')['salary'].sum()
df.groupby('department')['salary'].sum()
17

Intro to Seaborn

18 min
What you'll learn
  • Create beautiful statistical plots
  • Use seaborn's high-level API
  • Make publication-ready charts

Seaborn builds on Matplotlib but makes statistical plots beautiful by default. Instead of manually styling every element, you write one line and get a clean, colored, labeled chart. For data exploration and reports, Seaborn is the fastest path from data to insight.

seaborn.py
import seaborn as sns
import matplotlib.pyplot as plt

tips = sns.load_dataset('tips')
sns.barplot(data=tips, x='day', y='total_bill', palette='viridis')
plt.title('Average Bill by Day')
plt.show()
Live Preview
Intro to Seaborn
Jan
Feb
Mar
Apr
💡 Tip: Seaborn's built-in datasets (tips, iris, penguins) are perfect for practice.
Try it yourself

Create a Seaborn histogram of a dataset.

sns.histplot(data=df, x='column')
sns.histplot(data=df, x='value')
plt.show()
18

Exploratory Data Analysis (EDA)

22 min
What you'll learn
  • Understand the EDA process
  • Generate summary statistics
  • Spot patterns before modeling

EDA is the detective phase: before building any model, you explore the data to understand its shape, find anomalies, and form hypotheses. The toolkit: describe() for summary stats, histograms for distributions, correlation matrices for relationships, and boxplots for outliers. EDA done well makes everything after it easier.

eda.py
import pandas as pd

df = pd.read_csv('data.csv')
print(df.describe())
print('\nMissing values:')
print(df.isnull().sum())
print('\nCorrelations:')
print(df.corr(numeric_only=True))
Live Preview
Exploratory Data Analysis (EDA)
✓ Best Practice: Never skip EDA — models trained on unexplored data fail in production.
Try it yourself

Use describe() on a DataFrame and find the max value of one column.

df.describe() then look at the max row.
df.describe().loc['max']
19

Data Storytelling

16 min
What you'll learn
  • Communicate insights clearly
  • Choose the right visualization
  • Write compelling narratives

Analysis without communication is wasted effort. Data storytelling means turning numbers into a clear narrative: what's the key finding, why does it matter, and what should happen next? A good chart plus a clear headline beats a dashboard of confusing visuals. This is what separates analysts from data scientists who influence decisions.

storytelling.py
# A good data story has:
# 1. A clear question
# 2. A single key insight
# 3. One chart that proves it
# 4. A recommended action

insight = 'Sales rose 40% after the marketing campaign'
action = 'Double the campaign budget next quarter'
Output
python
A clear narrative: the insight and the recommended action in two lines.
💡 Tip: Start with the conclusion, then show the evidence — don't make your audience guess the point.
Try it yourself

Write a one-sentence insight about sales dropping in winter.

What + why + so what.
Winter sales fell 30% — likely seasonality — so stock accordingly.
20

Capstone: Analyze a Real Dataset

45 min
What you'll learn
  • Apply the full data science workflow
  • Clean, explore, and visualize data
  • Produce a summary report

Time to put it all together. You'll load a real dataset (start with Seaborn's built-in tips or iris), clean it, explore with describe() and groupby, visualize distributions and relationships, and write a short summary of findings. This complete mini-project proves you can do the full workflow end to end.

capstone.py
import seaborn as sns
import pandas as pd

# Load, clean, explore, visualize
df = sns.load_dataset('tips')
print(df.head())
print(df.describe())
print(df.groupby('day')['total_bill'].mean())
sns.heatmap(df.corr(numeric_only=True), annot=True, cmap='YlGnBu')
plt.show()
Live Preview
Capstone: Analyze a Real Dataset
✓ Best Practice: This capstone is portfolio-ready — the exact workflow employers expect you to know.
Try it yourself

Find which day has the highest average tip.

df.groupby('day')['tip'].mean()
df.groupby('day')['tip'].mean().idxmax()
You've completed all 20 lessons. Ready for more?

Continue to Data Science Intermediate for machine learning, feature engineering, and advanced analysis.

📱 Scan this QR code with your phone camera to instantly open this page.

Works on iOS, Android, and any modern device. No app installation required.

Account Verified!

Your email has been verified successfully.