📋 বিষয়সূচী

01

Data Visualization পরিচিতি

⏱ ১৫ মিনিট · সম্পূর্ণ শূন্য থেকে শুরু

গল্প: সেলস রিপোর্টের কাহিনী 📊

একটি বড় সুপারশপের মালিক রাফিউল সাহেব। তার ম্যানেজার প্রতি মাসে ৫০০ লাইনের Excel ফাইল পাঠায়। রাফিউল সাহেব ঘণ্টার পর ঘণ্টা দেখেও বুঝতে পারছেন না — কোন পণ্য ভালো বিকোচ্ছে, কোন মাসে বিক্রি বেশি। তারপর একজন Data Analyst এসে একটি রঙিন চার্ট দেখাল — মাত্র ৩০ সেকেন্ডে রাফিউল সাহেব বুঝলেন সব! এটাই Data Visualization-এর শক্তি।

📖 Data Visualization কী?

Data Visualization হলো সংখ্যা ও তথ্যকে চার্ট, গ্রাফ ও ছবির মাধ্যমে দৃশ্যমান করা — যাতে মানুষ দ্রুত বুঝতে পারে এবং সিদ্ধান্ত নিতে পারে।

🖱️ Interactive: টেবিল থেকে চার্ট — একই ডেটা, দুই রূপ

নিচের ৫ মাসের বিক্রি ডেটা দেখুন। টেবিল ও চার্টের মধ্যে পাল্টান।

মাসবিক্রি (টাকা)
✨ ৩০ সেকেন্ডে বুঝলেন — এটাই visualization! সংখ্যার ভিড়ে হারিয়ে যাওয়ার বদলে চার্টে প্যাটার্ন স্পষ্ট।

🧠 মানুষের মস্তিষ্ক ছবি বোঝে দ্রুত!

গবেষণায় দেখা গেছে, মানুষের মস্তিষ্ক একটি ছবি প্রক্রিয়া করতে মাত্র ১৩ মিলিসেকেন্ড নেয়। কিন্তু ৫০০ লাইনের টেবিল বুঝতে লাগে মিনিটের পর মিনিট।

02

Chart Gallery — এক ডেটা, সব চার্ট

⏱ ২৫ মিনিট · Rafiul সাহেবের সুপারশপ ডেটা

🛒 shopSales Dataset

একই shopSales ডেটাসেট থেকে ১২+ ভিন্ন chart দেখব। প্রতিটি card-এ ডেটা | চার্ট | কোড tab আছে — ক্লিক করে explore করুন।

🎚️ Live Bar Chart Builder

স্লাইডার দিয়ে মাসিক বিক্রি বদলান — চার্ট তাৎক্ষণিক আপডেট হবে। সর্বোচ্চ বার হাইলাইট হবে।

🎯 Chart Picker Game

প্রশ্ন পড়ে সঠিক chart type বেছে নিন।

03

EDA — ডেটা বোঝার প্রথম ধাপ

⏱ ২০ মিনিট · Machine Learning-এর আগে

গল্প: ডাক্তারের পরীক্ষা 🏥

একজন ভালো ডাক্তার সরাসরি ওষুধ লেখেন না। প্রথমে রোগীর সম্পূর্ণ পরীক্ষা করেন। EDA একই কাজ করে ডেটার জন্য — সরাসরি ML মডেল চালালে ভুল ফলাফল আসে!

📖 EDA কী?

Exploratory Data Analysis (EDA) হলো ডেটাকে পদ্ধতিগতভাবে বিশ্লেষণ করা — Missing Value, Outlier, Distribution, Correlation দেখা। Data Science-এর সবচেয়ে গুরুত্বপূর্ণ প্রথম ধাপ।

🔬 EDA Step-by-Step Lab

প্রতিটি ধাপে ক্লিক করুন — কী করবেন ও কী শিখবেন দেখুন।

✅ EDA Checklist (ক্লিক করে টিক দিন)

04

সঠিক Chart বেছে নেওয়া

⏱ ১০ মিনিট · Interactive Wizard

🧭 Chart Decision Wizard

দুইটি প্রশ্নের উত্তর দিন — সঠিক chart সুপারিশ পাবেন।

ধাপ ১: আপনার ডেটা কী ধরনের?

ধাপ ২: আপনি কী দেখাতে চান?

🎯 Chart নির্বাচনের সারাংশ

লক্ষ্যসেরা Chart
Category তুলনা📊 Bar Chart
সময়ের সাথে পরিবর্তন📈 Line Chart
অংশ/ভাগ (%)🥧 Pie Chart
বণ্টন📉 Histogram / Box Plot
দুটো সংখ্যার সম্পর্ক⚫ Scatter Plot
Correlation🌡️ Heatmap
05

Google Colab হাতে-কলমে

⏱ Hands-on · Basic EDA + ১২ chart · এক ডেটা

📋 Project: সুপারশপের বিক্রি বিশ্লেষণ (shopSales)

Part 02-এর Chart Gallery-তে যে shopSales ডেটা দেখেছেন — সেটাই এখানে Python-এ। ধাপ ১: setup চালান → ধাপ ২: Basic EDA (shape, missing, describe…) → ধাপ ৩: chart visualize। Chip থেকে যেকোনো EDA step বা chart-এ jump করুন — সব একই df ব্যবহার করে।

ধাপ ১ — Setup ও shopSales Dataset (৭ কলাম)
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import warnings
warnings.filterwarnings('ignore')

plt.style.use('seaborn-v0_8')
sns.set_palette('husl')

# মাসের ক্রম — Line, Area, Stacked chart-এ ব্যবহার হবে
month_order = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']

# Rafiul সাহেবের সুপারশপ — gallery-র একই shopSales ডেটা
np.random.seed(42)
n = 500
df = pd.DataFrame({
    'Month': np.random.choice(month_order, n),
    'Category': np.random.choice(['Electronics','Food','Clothing','Books','Toys'], n),
    'Sales': np.random.randint(500, 10000, n),
    'Customers': np.random.randint(10, 200, n),
    'Satisfaction': np.random.uniform(3.0, 5.0, n).round(1),
    'Latitude': np.random.uniform(23.70, 23.90, n).round(4),
    'Longitude': np.random.uniform(90.35, 90.45, n).round(4)
})
print('Dataset তৈরি!', df.shape)
print(df.head())
Dataset তৈরি! (500, 7) Month Category Sales Customers Satisfaction Latitude Longitude 0 Jun Food 3421 87 4.2 23.7823 90.4021 1 Mar Electronics 8901 156 3.8 23.8456 90.3789 ...
গুরুত্বপূর্ণ: এই একটা df দিয়ে নিচের EDA ও সব chart চালাবেন — আলাদা ডেটা লাগবে না।

EDA ও Chart — কোডে যেতে ক্লিক করুন

Teal chip = Basic EDA · Blue chip = Chart visualization — setup-এর পর যেকোনো ক্রমে চালান।

🔍 EDA — Shape ও প্রথম সারি

এই step দিয়ে কী বুঝবেন: Dataset কত বড় (সারি/কলাম) এবং ডেটা দেখতে কেমন।

print('Shape:', df.shape)        # (500, 7) — 500 rows, 7 columns
print('\nFirst 5 rows:')
display(df.head())       # Colab-এ display(); না থাকলে print(df.head())
print('\nLast 3 rows:')
display(df.tail(3))
Shape: (500, 7) First 5 rows: Month Category Sales Customers Satisfaction Latitude Longitude 0 Jun Food 3421 87 4.2 23.7823 90.4021 ...
শিখলাম: প্রথমে সাইজ, তারপর sample rows — ML-এর আগে ডেটা চোখে দেখা জরুরি।
📋 EDA — dtypes ও info()

এই step দিয়ে কী বুঝবেন: কোন column সংখ্যা (int/float) আর কোনটা text (object)।

print('Column types:')
print(df.dtypes)
print('\n--- df.info() ---')
df.info()
Column types: Month object Category object Sales int64 Customers int64 Satisfaction float64 ... <class 'pandas.DataFrame'> RangeIndex: 500 entries, 0 to 499 Data columns (total 7 columns)
শিখলাম: Month/Category = categorical, Sales/Customers = numeric — chart বেছে নেওয়ার আগে type জানতে হবে।
❓ EDA — Missing Value

এই step দিয়ে কী বুঝবেন: কোন column-এ ফাঁকা (null) value আছে কিনা।

missing = df.isnull().sum()
print('Missing per column:')
print(missing)
print('\nTotal missing:', missing.sum())

# real dataset-এ missing থাকলে: drop / fill / impute করতে হবে
# df = df.dropna()           # সারি মুছে ফেলা
# df['Sales'].fillna(0)      # 0 দিয়ে পূরণ
Missing per column: Month 0 Category 0 Sales 0 Customers 0 ... Total missing: 0
শিখলাম: shopSales-এ missing নেই — কিন্তু real project-এ এটাই প্রথম চেক।
📊 EDA — describe() ও value_counts()

এই step দিয়ে কী বুঝবেন: সংখ্যার mean/min/max/std এবং category frequency।

print('Numeric summary:')
display(df.describe())

print('\nCategory count:')
print(df['Category'].value_counts())

# outlier দেখতে Box Plot chip (#colab-box) এ যান
Numeric summary: Sales Customers Satisfaction count 500.00 500.00 500.00 mean 5214.00 104.50 4.01 max 9991.00 199.00 5.00 ... Category count: Electronics 108 Food 102 ...
শিখলাম: describe() = সংখ্যার সারাংশ; value_counts() = কোন category বেশি। Outlier → Box Plot chip।
📉 EDA — Sales Distribution

এই step দিয়ে কী বুঝবেন: Sales কোন range-এ বেশি — distribution কেমন।

print('Sales stats:', df['Sales'].describe())

plt.figure(figsize=(10, 5))
plt.hist(df['Sales'], bins=20, color='#0F6E56', edgecolor='white', alpha=0.85)
sns.kdeplot(df['Sales'], color='#085041', linewidth=2)
plt.title('Sales Distribution (Histogram + KDE)')
plt.xlabel('Sales (টাকা)'); plt.ylabel('Frequency')
plt.tight_layout(); plt.show()

# styled chart → Histogram chip (#colab-histogram)
Sales stats: mean≈5214, std≈2704 [Histogram — বেশিরভাগ transaction ~3000–7000 range-এ]
শিখলাম: histogram = distribution shape; KDE = smooth curve। Full chart → Histogram chip।
🔗 EDA — Correlation

এই step দিয়ে কী বুঝবেন: Sales, Customers, Satisfaction-এর মধ্যে সম্পর্ক (+1 = একসাথে বাড়ে)।

num_cols = ['Sales', 'Customers', 'Satisfaction']
corr = df[num_cols].corr()
print('Correlation matrix:')
display(corr)

print(f"\nSales ↔ Customers: {corr.loc['Sales','Customers']:.2f}")
# ~0.7+ মানে positive relationship — বেশি customer, বেশি sales

# visual heatmap → Heatmap chip (#colab-heatmap)
Correlation matrix: Sales Customers Satisfaction Sales 1.00 0.72 0.05 Customers 0.72 1.00 0.03 ... Sales ↔ Customers: 0.72
শিখলাম: corr() = সংখ্যায় সম্পর্ক; Heatmap chip = রঙিন matrix chart।
📊 Bar Chart — Category তুলনা

এই chart দিয়ে কী বুঝবেন: Category অনুযায়ে মোট বিক্রি তুলনা — কোন পণ্য সবচেয়ে বেশি বিক্রি?

cat_sales = df.groupby('Category')['Sales'].sum().sort_values(ascending=False)
plt.figure(figsize=(10, 5))
plt.bar(cat_sales.index, cat_sales.values, color='#185FA5', edgecolor='white')
plt.title('Category অনুযায়ী মোট বিক্রি')
plt.xlabel('Category'); plt.ylabel('মোট বিক্রি (টাকা)')
plt.tight_layout(); plt.show()
[Bar chart — Electronics সর্বোচ্চ, Books সর্বনিম্ন]
📈 Line Chart — মাসিক Trend

এই chart দিয়ে কী বুঝবেন: মাসিক বিক্রির trend — কোন মাসে বিক্রি বেশি/কম?

monthly = df.groupby('Month')['Sales'].sum().reindex(month_order)
plt.figure(figsize=(10, 5))
plt.plot(monthly.index, monthly.values, marker='o', color='#3B6D11', linewidth=2)
plt.title('মাসিক বিক্রির Trend')
plt.xlabel('Month'); plt.ylabel('বিক্রি')
plt.xticks(rotation=45); plt.tight_layout(); plt.show()
[Line chart — সময়ের সাথে বিক্রি ওঠানামা]
🥧 Pie Chart — Market Share (%)

এই chart দিয়ে কী বুঝবেন: মোট বিক্রির মধ্যে প্রতিটি category-র অংশ (%).

cat_sales = df.groupby('Category')['Sales'].sum()
plt.figure(figsize=(8, 8))
plt.pie(cat_sales.values, labels=cat_sales.index, autopct='%1.1f%%', startangle=90)
plt.title('Category অনুযায়ী Market Share')
plt.tight_layout(); plt.show()
[Pie chart — প্রতিটি slice-এ % দেখাবে]
📉 Histogram — Sales Distribution

এই chart দিয়ে কী বুঝবেন: Sales-এর distribution — কোন range-এ বেশি transaction?

plt.figure(figsize=(10, 5))
plt.hist(df['Sales'], bins=20, color='#185FA5', edgecolor='white')
plt.title('Sales-এর Distribution')
plt.xlabel('Sales (টাকা)'); plt.ylabel('Frequency')
plt.tight_layout(); plt.show()
[Histogram — কোন price range-এ বেশি বিক্রি]
⚫ Scatter Plot — Sales vs Customers

এই chart দিয়ে কী বুঝবেন: Sales vs Customers — বেশি customer = বেশি sales?

plt.figure(figsize=(10, 5))
plt.scatter(df['Customers'], df['Sales'], alpha=0.6, color='#185FA5')
plt.title('Customers বনাম Sales')
plt.xlabel('Customers'); plt.ylabel('Sales')
plt.tight_layout(); plt.show()
[Scatter — ডানে উপরে = positive relationship]
📦 Box Plot — Outlier ধরা

এই chart দিয়ে কী বুঝবেন: Category অনুযায়ে Sales-এর median ও outlier।

plt.figure(figsize=(10, 5))
sns.boxplot(data=df, x='Category', y='Sales', palette='husl')
plt.title('Category অনুযায়ী Sales (Box Plot)')
plt.tight_layout(); plt.show()
[Box plot — median, IQR ও outlier বিন্দু দেখাবে]
🔵 Count Plot — Category Frequency

এই chart দিয়ে কী বুঝবেন: প্রতিটি category কতবার এসেছে — frequency।

plt.figure(figsize=(10, 5))
sns.countplot(data=df, x='Category', palette='husl')
plt.title('Category Frequency (Count Plot)')
plt.tight_layout(); plt.show()
[Count plot — প্রতিটি category কত transaction]
🌡️ Heatmap — Correlation Matrix

এই chart দিয়ে কী বুঝবেন: Feature-গুলোর মধ্যে correlation — কোনটা কোনটার সাথে সম্পর্কিত?

num_cols = ['Sales', 'Customers', 'Satisfaction']
plt.figure(figsize=(8, 6))
sns.heatmap(df[num_cols].corr(), annot=True, cmap='coolwarm', fmt='.2f')
plt.title('Correlation Matrix')
plt.tight_layout(); plt.show()
[Heatmap — Sales-Customers correlation ~0.7+]
🏔️ Area Chart — Cumulative বিক্রি

এই chart দিয়ে কী বুঝবেন: Cumulative মাসিক বিক্রি — মোট কত জমা হচ্ছে?

monthly = df.groupby('Month')['Sales'].sum().reindex(month_order)
cumulative = monthly.cumsum()
plt.figure(figsize=(10, 5))
plt.fill_between(range(len(cumulative)), cumulative.values, alpha=0.4, color='#3B6D11')
plt.plot(range(len(cumulative)), cumulative.values, color='#3B6D11', linewidth=2)
plt.xticks(range(12), month_order, rotation=45)
plt.title('Cumulative মাসিক বিক্রি')
plt.tight_layout(); plt.show()
[Area chart — মাস যাওয়ার সাথে মোট বিক্রি বাড়ছে]
📊 Stacked Bar — Category per Month

এই chart দিয়ে কী বুঝবেন: মাসে মাসে প্রতিটি category-র অবদান।

pivot = df.pivot_table(index='Month', columns='Category', values='Sales', aggfunc='sum').reindex(month_order)
pivot.plot(kind='bar', stacked=True, figsize=(12, 6), colormap='husl')
plt.title('মাসিক Stacked Bar — Category ভাগ')
plt.xlabel('Month'); plt.legend(title='Category', bbox_to_anchor=(1.05, 1))
plt.tight_layout(); plt.show()
[Stacked bar — প্রতি মাসে category-wise অবদান]
🎻 Violin Plot — Satisfaction by Category

এই chart দিয়ে কী বুঝবেন: Category অনুযায়ী Satisfaction-এর shape।

plt.figure(figsize=(10, 5))
sns.violinplot(data=df, x='Category', y='Satisfaction', palette='husl')
plt.title('Category অনুযায়ী Satisfaction')
plt.tight_layout(); plt.show()
[Violin plot — distribution shape + density]
🗺️ Geo Scatter — Delivery Locations

এই chart দিয়ে কী বুঝবেন: ডেলিভারি লোকেশন — ঢাকায় কোথায় বেশি order?

plt.figure(figsize=(10, 8))
plt.scatter(df['Longitude'], df['Latitude'],
            s=df['Sales']/50, alpha=0.6, c=df['Sales'], cmap='viridis')
plt.colorbar(label='Sales')
plt.title('Delivery Locations (ঢাকা)')
plt.xlabel('Longitude'); plt.ylabel('Latitude')
plt.tight_layout(); plt.show()
[Geo scatter — বড় বিন্দু = বেশি sales, ঢাকা এলাকায় ছড়িয়ে]
06

Revision & MCQ

⏱ Quick Revision · MCQ

⚡ Quick Revision

Bar = Category তুলনা · Line = Trend · Pie = % ভাগ · Histogram = Distribution · Box = Outlier · Scatter = Relationship · EDA = Model-এর আগে!

📝 MCQ — বিকল্পে ক্লিক করুন

১. কোন Chart সময়ের সাথে পরিবর্তন দেখানোর জন্য সবচেয়ে উপযুক্ত?
ক Bar Chart
খ Line Chart
গ Pie Chart
ঘ Box Plot
২. Outlier ধরার জন্য সেরা Chart কোনটি?
ক Pie Chart
খ Histogram
গ Box Plot
ঘ Line Chart
৩. EDA-র সম্পূর্ণ নাম কী?
ক Extra Data Analysis
খ Exploratory Data Analysis
গ Extended Data Algorithm
ঘ Extracted Data Approach
৪. Histogram ও Bar Chart-এর মূল পার্থক্য?
ক Histogram রঙিন, Bar নয়
খ Histogram continuous, Bar category-তে
গ কোনো পার্থক্য নেই
ঘ Bar ছোট, Histogram বড়
৫. Correlation Matrix দেখানোর জন্য কোন Chart?
ক Scatter Plot
খ Heatmap
গ Bar Chart
ঘ Pie Chart

📌 পরবর্তী ক্লাসে (Advanced Topics)

Time Series: Trend, Seasonality, Cyclic pattern — Line/Area chart দিয়ে দীর্ঘমেয়াদী বিশ্লেষণ।

Geospatial: Latitude/Longitude দিয়ে মানচিত্রে ডেটা — Food delivery, ride sharing।

Full Dashboard: ৬+ chart একসাথে subplots(2,3) দিয়ে — business presentation-এর জন্য।

→ পরবর্তী: Module 10 Advanced Data Visualization — Text ৫ · Multidim ৫ · Comparative ৪

🎉 অভিনন্দন! Module 01 সম্পন্ন!

আপনি শিখেছেন: Visualization-এর শক্তি, ১২+ Chart Type, EDA workflow, Chart selection ও Python কোডিং ভিত্তি।

পরের module: Data Processing for ML →