दिन 53: Git, GitHub और Portfolio
✅ आज आप सीखेंगे
- हर data team Git क्यों इस्तेमाल करती है
- रोज़ के commands: init, add, commit, push
- Branches, pull requests और merge
- Data के लिए project structure और .gitignore
- ऐसा README और portfolio जो interviews दिलाए
🏢 असली दुनिया में
Recruiter के पास 200 applications और हर एक के लिए 30 सेकंड हैं। CV पर “pandas आता है” कुछ साबित नहीं करता; चार साफ़ projects, पढ़ने लायक READMEs और charts वाला GitHub link सब साबित करता है। आपकी भावी team भी रोज़ code share और review करने के लिए Git ही इस्तेमाल करेगी।
एक तस्वीर में Git
एक बार का setup
# install: https://git-scm.com (Windows: Git Bash) | check: git --version git config --global user.name "Your Name" git config --global user.email "you@example.com" git config --global init.defaultBranch main
Professional project structure
from pathlib import Path
root = Path("bazaarkart-sales-eda")
folders = ["data/raw", "data/processed", "notebooks", "src", "reports/figures", "app"]
for f in folders:
(root / f).mkdir(parents=True, exist_ok=True)
(root / "src" / "__init__.py").write_text("")
(root / "src" / "clean.py").write_text('''"""Reusable cleaning functions for BazaarKart data."""
import pandas as pd
def load_sales(path: str) -> pd.DataFrame:
df = pd.read_csv(path, parse_dates=["order_date"]).drop_duplicates()
df["revenue"] = df["quantity"] * df["unit_price"] * (1 - df["discount"])
return df
''')
(root / "requirements.txt").write_text("pandas==2.3.3\nmatplotlib==3.11.0\nseaborn==0.13.2\nscikit-learn==1.9.1\n")
(root / ".gitignore").write_text("__pycache__/\n.ipynb_checkpoints/\n.env\n*.joblib\ndata/raw/*.csv\n!data/raw/sample.csv\n")
for p in sorted(root.rglob("*")):
depth = len(p.relative_to(root).parts) - 1
print(" " * depth + ("📁 " if p.is_dir() else "📄 ") + p.name)Passwords, API keys और .env files .gitignore में होनी चाहिए – bots मिनटों में GitHub पर leaked keys ढूँढते हैं। बड़ी या private CSVs भी commit न करें; छोटा sample दें और पूरा data पाने का तरीका बताएँ।
रोज़ का workflow
cd bazaarkart-sales-eda git init # start tracking this folder git status # what changed? git add README.md src/ notebooks/ # stage files git commit -m "Add cleaning function and EDA notebook" git log --oneline # history # connect to GitHub (create an empty repo on github.com first) git remote add origin https://github.com/<your-username>/bazaarkart-sales-eda.git git push -u origin main
| Command | मतलब |
|---|---|
| git status | बदली / नई files दिखाएँ |
| git diff | Line-दर-line बदलाव |
| git add file | बदलाव को अगले snapshot में डालें |
| git commit -m "msg" | Message के साथ snapshot save |
| git log --oneline | Snapshots की list |
| git restore file | File के uncommitted बदलाव वापस |
| git pull | GitHub से नया लाएँ |
| git push | अपने commits GitHub पर भेजें |
Present tense में क्या और क्यों लिखें: “Add festive-season feature to churn model”, न कि “changes” या “final_final_v3”। छोटे, तार्किक कदम commit करें।
Branches और pull requests
git switch -c feature/add-rfm-segments # new branch for an experiment # ... edit, add, commit ... git push -u origin feature/add-rfm-segments # On GitHub: open a Pull Request → teammate reviews → "Merge" git switch main git pull # main now has the merged work
- 1एक task के लिए branch बनाएँ
- 2वहाँ काम commit करें
- 3Pull request खोलें
- 4Review और चर्चा
- 5main में merge
ऐसा README जो recruiters पढ़ें
from pathlib import Path
readme = """# 🛒 BazaarKart 2024 Sales Analysis
**Question:** What drove BazaarKart’s ₹68.8 lakh revenue in 2024, and where should we invest in 2025?
## 🔑 Key findings
| # | Finding | Recommendation |
|---|---------|----------------|
| 1 | Oct–Nov brought **27%** of revenue in 17% of the year | Plan stock & staff 6 weeks before Diwali |
| 2 | Mumbai, Bengaluru, Delhi = **43%** of revenue | Same-day delivery in these metros |
| 3 | Bigger discounts did **not** raise quantity or rating | Replace blanket discounts with A/B-tested offers |
| 4 | 25–34 year-olds paying by UPI are the core customer | UPI cashback instead of COD promotions |

## 🧰 Tools
Python · pandas · Matplotlib · Seaborn · SQL (SQLite)
## 📂 Structure
```
data/ raw and processed data (raw CSVs not committed)
notebooks/ 01_cleaning.ipynb, 02_eda.ipynb
src/ reusable functions (clean.py)
reports/ figures and the one-page summary
```
## ▶️ Run it
```bash
pip install -r requirements.txt
jupyter notebook notebooks/02_eda.ipynb
```
## 👤 Author
Your Name · [LinkedIn](https://www.linkedin.com/in/your-profile) · your.email@example.com
"""
Path("bazaarkart-sales-eda/README.md").write_text(readme, encoding="utf-8")
print(readme[:420] + "...")
print("README length:", len(readme.split()), "words")आपका portfolio plan (इसी course से)
| Project | क्या दिखाता है | Course days |
|---|---|---|
| BazaarKart sales EDA | pandas, cleaning, EDA, storytelling | 15–19, 24 |
| HR / sales SQL warehouse | SQL joins, CTEs, window functions | 32–35 |
| नए checkout का A/B test | Statistics, experiment design | 29–31 |
| Telecom churn prediction + app | ML pipeline, metrics, deployment | 56–60 |
Recruiters Titanic और Iris datasets हज़ार बार देख चुके हैं। अपना सवाल, data.gov.in या Kaggle से दूसरा dataset (Indian data अलग दिखता है), और अपने सुझाव जोड़ें।
### Hi, I'm Your Name 👋 Aspiring **Data Analyst / Data Scientist** · Python · SQL · Power BI · Machine Learning 📌 **Featured projects** - 🛒 [BazaarKart Sales EDA](https://github.com/<username>/bazaarkart-sales-eda) – festive season = 27% of revenue - 📞 [Telecom Churn Prediction](https://github.com/<username>/telecom-churn) – AUC 0.83, Streamlit app - 🧪 [Checkout A/B Test](https://github.com/<username>/checkout-ab-test) – +2.9 pp conversion, p = 0.006 📫 your.email@example.com · [LinkedIn](https://www.linkedin.com/in/your-profile)
🏅 आज के Job Skills
Practice tasks
🏋️ Practice – ख़ुद करें
bazaarkart-sales-eda folder push करें और repository को profile पर pin करें।Quick quiz
🧠 Quick Quiz – ख़ुद को जाँचें
Interview corner
💼 Interview Corner
Data-science project का version control कैसे करते हैं?
Code, notebooks और छोटे sample data के लिए Git; secrets और बड़े data के लिए .gitignore; packages के लिए requirements.txt; data और models cloud storage या DVC जैसे tools में; साथ काम के लिए branches और pull requests।
अपने GitHub का एक project बताइए।
Business सवाल, data, अपने दो-तीन मुख्य कदम, number के साथ मुख्य नतीजा, और आगे क्या करते – से शुरू करें। दो मिनट से कम रखें और README खुला रखें।
सारांश
- add → commit → push; status और log बताते हैं आप कहाँ हैं।
- Branches + pull requests = सुरक्षित teamwork।
- साफ़ structure, secrets/data के लिए .gitignore, requirements.txt।
- Business-first READMEs वाले चार मज़बूत projects = आपका portfolio।
Day 54: resume, LinkedIn और job search – अपने projects को interview calls में बदलें।
