M28 Python Lab & Python Library Atlas

आप क्या सीखेंगे: a separate, self-contained section — learn Python from zero, then master the libraries used across finance, quant research, ML and trading systems. Every lesson has runnable code in the browser (Pyodide) and a downloadable notebook. Shown in Part A after M26 and before M04 Statistics.

पहले यह सीखें: M18 Mathematics for Trading

मॉड्यूल परीक्षा

विषय पूरे करने के बाद पूरे मॉड्यूल की समयबद्ध परीक्षा आपको ऐसा प्रमाणपत्र दिलाती है जिसे आप साझा कर सकते हैं और कोई भी जाँच सकता है।

मॉड्यूल परीक्षा देखें

अध्याय

  1. C01 Setup & Tooling अध्याय क्विज़

    • Installing Python; versions and the interpreter · जल्द आ रहा है
    • Virtual environments: venv, conda, uv/poetry; pip basics · जल्द आ रहा है
    • Jupyter, VS Code and running scripts · जल्द आ रहा है
    • Project layout and the "requirements" file · जल्द आ रहा है
    • Getting help: docs, `help()`, error messages · जल्द आ रहा है
  2. C02 Language Basics अध्याय क्विज़

    • Numbers, strings, booleans and None · जल्द आ रहा है
    • Variables, operators and f-strings · जल्द आ रहा है
    • Conditions: if / elif / else · जल्द आ रहा है
    • Loops: for, while, break, continue, enumerate, zip · जल्द आ रहा है
    • Input, output and formatting numbers (currency, percent) · जल्द आ रहा है
  3. C03 Data Structures अध्याय क्विज़

    • Lists, tuples, sets and dictionaries · जल्द आ रहा है
    • Slicing, sorting and comprehensions · जल्द आ रहा है
    • Nested structures and JSON-like data · जल्द आ रहा है
    • Choosing the right structure (complexity in plain words) · जल्द आ रहा है
    • Mutable vs immutable; copying pitfalls · जल्द आ रहा है
  4. C04 Functions, Modules & OOP अध्याय क्विज़

    • Functions, arguments, defaults, *args/**kwargs · जल्द आ रहा है
    • Scope, closures, lambda and higher-order functions · जल्द आ रहा है
    • Importing modules and packages; writing your own · जल्द आ रहा है
    • Classes and objects: Position, Order, Portfolio · जल्द आ रहा है
    • Inheritance, composition and dataclasses · जल्द आ रहा है
    • Generators, iterators and decorators · जल्द आ रहा है
  5. C05 Standard Library for Finance अध्याय क्विज़

    • datetime, zoneinfo, calendar: trading days and time zones · जल्द आ रहा है
    • collections, itertools, functools · जल्द आ रहा है
    • math, statistics, decimal and fractions (money precision!) · जल्द आ रहा है
    • pathlib, os, csv, json, sqlite3 · जल्द आ रहा है
    • random and seeds for reproducible simulations · जल्द आ रहा है
    • logging, argparse, typing · जल्द आ रहा है
  6. C06 Writing Reliable Code अध्याय क्विज़

    • Errors and exceptions; defensive coding · जल्द आ रहा है
    • Testing with pytest; test data for finance code · जल्द आ रहा है
    • Type hints, linting and formatting · जल्द आ रहा है
    • Debugging and profiling · जल्द आ रहा है
    • Documentation, docstrings and style (PEP 8) · जल्द आ रहा है
  7. C07 NumPy: Numerical Arrays अध्याय क्विज़

    • Arrays, dtypes, shapes and broadcasting · जल्द आ रहा है
    • Vectorised returns, cumulative products and rolling maths · जल्द आ रहा है
    • Random numbers, Monte Carlo and the Generator API · जल्द आ रहा है
    • Linear algebra: dot, solve, eig, svd · जल्द आ रहा है
    • Pitfalls: NaN handling, float precision, views vs copies · जल्द आ रहा है
  8. C08 pandas: Time-Series Data Analysis अध्याय क्विज़

    • Series, DataFrame, index and dtypes · जल्द आ रहा है
    • Reading/writing CSV, Excel, Parquet, SQL · जल्द आ रहा है
    • Selecting, filtering, groupby, merge/join, pivot · जल्द आ रहा है
    • Time-series: DatetimeIndex, resample, rolling, shift, expanding · जल्द आ रहा है
    • Missing data, outliers and corporate-action adjustment · जल्द आ रहा है
    • MultiIndex for multi-asset panels · जल्द आ रहा है
    • Performance and memory tips; pitfalls (chained assignment, look-ahead via shift) · जल्द आ रहा है
  9. C09 Visualisation Libraries अध्याय क्विज़

    • Matplotlib: figure, axes, styling · जल्द आ रहा है
    • seaborn: distributions, heatmaps, pair plots · जल्द आ रहा है
    • Plotly and Bokeh: interactive charts · जल्द आ रहा है
    • Candlesticks: mplfinance, Plotly, lightweight-charts · जल्द आ रहा है
    • Altair and declarative charts · जल्द आ रहा है
    • Visual design for honest charts (links to the dataviz principles) · जल्द आ रहा है
  10. C10 SciPy & statsmodels: Statistics & Modelling अध्याय क्विज़

    • scipy.stats: distributions, tests and fitting · जल्द आ रहा है
    • scipy.optimize: minimise, root-finding, constraints · जल्द आ रहा है
    • scipy.interpolate, signal and sparse · जल्द आ रहा है
    • statsmodels: OLS, GLM, ARIMA, VAR, state-space · जल्द आ रहा है
    • Diagnostics: residual tests, ADF, Ljung-Box, cointegration · जल्द आ रहा है
    • arch: GARCH and volatility models · जल्द आ रहा है
  11. C11 Market Data Libraries अध्याय क्विज़

    • yfinance, pandas-datareader, OpenBB · जल्द आ रहा है
    • Local-exchange data wrappers (e.g. NSE/BSE tools, jugaad-data) *(country pack)* · जल्द आ रहा है
    • FRED/fredapi, Nasdaq Data Link and economic data · जल्द आ रहा है
    • Alpha Vantage, Polygon, Tiingo, Twelve Data (paid/free tiers) · जल्द आ रहा है
    • ccxt for crypto exchanges · जल्द आ रहा है
    • Data quality: adjusted prices, splits, time zones, rate limits and licences · जल्द आ रहा है
  12. C12 Technical Indicator Libraries अध्याय क्विज़

    • TA-Lib: installation, functions and speed · जल्द आ रहा है
    • pandas-ta and ta: pure-python indicators · जल्द आ रहा है
    • Writing your own indicator (and verifying it against a library) · जल्द आ रहा है
    • Indicator pitfalls: warm-up periods, repainting, look-ahead · जल्द आ रहा है
  13. C13 Backtesting Libraries अध्याय क्विज़

    • backtesting.py: a quick first backtest · जल्द आ रहा है
    • vectorbt: vectorised research at speed · जल्द आ रहा है
    • backtrader and zipline-reloaded: event-driven engines · जल्द आ रहा है
    • bt and other portfolio-level back-testers · जल्द आ रहा है
    • QuantConnect Lean and cloud platforms (overview) · जल्द आ रहा है
    • Comparing libraries on the same strategy; common hidden biases · जल्द आ रहा है
  14. C14 Portfolio, Performance & Risk Libraries अध्याय क्विज़

    • quantstats, empyrical and pyfolio-reloaded: tear-sheets · जल्द आ रहा है
    • PyPortfolioOpt, Riskfolio-Lib and skfolio: optimisation · जल्द आ रहा है
    • cvxpy: convex optimisation from scratch · जल्द आ रहा है
    • Risk: VaR/ES with numpy, scipy and arch · जल्द आ रहा है
    • Factor models and attribution tools · जल्द आ रहा है
  15. C15 Derivatives & Fixed-Income Libraries अध्याय क्विज़

    • QuantLib-Python: curves, bonds, options, swaps · जल्द आ रहा है
    • py_vollib / mibian: Black-Scholes, implied volatility, Greeks · जल्द आ रहा है
    • Option-chain handling with pandas · जल्द आ रहा है
    • Monte Carlo pricing with numpy/numba · जल्द आ रहा है
  16. C16 Machine-Learning Libraries अध्याय क्विज़

    • scikit-learn: pipelines, estimators, cross-validation · जल्द आ रहा है
    • XGBoost, LightGBM and CatBoost · जल्द आ रहा है
    • Time-series CV, purged k-fold implementations · जल्द आ रहा है
    • SHAP, permutation importance and interpretability · जल्द आ रहा है
    • Optuna / hyperopt for tuning; MLflow for experiment tracking · जल्द आ रहा है
    • sktime, tsfresh, tslearn, Prophet and darts for time series · जल्द आ रहा है
  17. C17 Deep-Learning Libraries अध्याय क्विज़

    • PyTorch: tensors, autograd, nn.Module, training loops · जल्द आ रहा है
    • TensorFlow/Keras and JAX (overview) · जल्द आ रहा है
    • PyTorch Lightning, pytorch-forecasting and GPU basics · जल्द आ रहा है
    • Hugging Face transformers and datasets · जल्द आ रहा है
    • Reproducibility: seeds, determinism and checkpoints · जल्द आ रहा है
  18. C18 Reinforcement-Learning Libraries अध्याय क्विज़

    • Gymnasium: building a custom trading environment · जल्द आ रहा है
    • Stable-Baselines3: PPO, A2C, SAC, DQN · जल्द आ रहा है
    • FinRL and other finance-RL frameworks · जल्द आ रहा है
    • Ray RLlib (overview) and evaluation tooling · जल्द आ रहा है
  19. C19 NLP & LLM Libraries अध्याय क्विज़

    • NLTK, spaCy and text cleaning · जल्द आ रहा है
    • Transformers: FinBERT and sentence embeddings · जल्द आ रहा है
    • Scraping and feeds: requests, BeautifulSoup, feedparser, newsapi clients · जल्द आ रहा है
    • LLM SDKs, tool-calling and structured output · जल्द आ रहा है
    • Agent frameworks: LangChain/LangGraph, LlamaIndex (overview) and building without a framework · जल्द आ रहा है
    • Vector stores and retrieval over filings · जल्द आ रहा है
  20. C20 Performance & Big-Data Libraries अध्याय क्विज़

    • numba and Cython: speeding up loops · जल्द आ रहा है
    • polars and DuckDB: fast analytics · जल्द आ रहा है
    • dask, ray and multiprocessing · जल्द आ रहा है
    • pyarrow, Parquet and memory-mapped files · जल्द आ रहा है
    • Choosing between pandas, polars and DuckDB · जल्द आ रहा है
  21. C21 Apps, Dashboards & Services अध्याय क्विज़

    • Streamlit, Dash and Gradio: dashboards in minutes · जल्द आ रहा है
    • FastAPI and Flask: serving models and strategies · जल्द आ रहा है
    • Jinja reports, PDF and Excel export (openpyxl, xlsxwriter, reportlab) · जल्द आ रहा है
    • Packaging an app: Docker and deployment basics · जल्द आ रहा है
  22. C22 Broker, Exchange & Execution APIs अध्याय क्विज़

    • Broker SDKs (e.g. Zerodha Kite Connect, Upstox, Angel One, Dhan; Alpaca, Interactive Brokers) *(country pack)* · जल्द आ रहा है
    • ib_insync / ib_async and streaming order updates · जल्द आ रहा है
    • FIX with QuickFIX (overview) · जल्द आ रहा है
    • Order wrappers: idempotency, retries, kill-switch · जल्द आ रहा है
    • Paper-trading sandboxes vs live accounts · जल्द आ रहा है
  23. C23 Databases & Messaging Libraries अध्याय क्विज़

    • sqlite3, SQLAlchemy and psycopg · जल्द आ रहा है
    • TimescaleDB, ClickHouse and ArcticDB for time-series · जल्द आ रहा है
    • Redis for caching and state · जल्द आ रहा है
    • Kafka and message queues (overview) · जल्द आ रहा है
    • Schema design and migration tools · जल्द आ रहा है
  24. C24 Automation, Scheduling & Alerts अध्याय क्विज़

    • cron, schedule, APScheduler · जल्द आ रहा है
    • Workflow tools: Prefect and Airflow (overview) · जल्द आ रहा है
    • Alerts: Telegram/e-mail bots · जल्द आ रहा है
    • Monitoring: logging, health checks, retries · जल्द आ रहा है
  25. C25 Quality, Packaging & Dev Tools अध्याय क्विज़

    • pytest, hypothesis (property-based tests) · जल्द आ रहा है
    • ruff, black, mypy and pre-commit · जल्द आ रहा है
    • Packaging with pyproject, uv/poetry · जल्द आ रहा है
    • Documentation with Sphinx/MkDocs · जल्द आ रहा है
  26. C26 Library Selection Guide & Cheat Sheets अध्याय क्विज़

    • Decision table: which library for which job · जल्द आ रहा है
    • How to evaluate a library: maintenance, licence, community, speed, docs · जल्द आ रहा है
    • Pinning versions, handling deprecations and breaking changes · जल्द आ रहा है
    • Common library-conflict problems and fixes · जल्द आ रहा है
    • One-page cheat sheets: NumPy, pandas, Matplotlib, scikit-learn, SQL · जल्द आ रहा है
  27. C28 Debugging Finance Code: the Bug Clinic अध्याय क्विज़

    • Look-ahead bugs via shift, rolling and resample · जल्द आ रहा है
    • Units, annualisation and percent-vs-fraction errors · जल्द आ रहा है
    • Time zones, calendars, holidays and missing data · जल्द आ रहा है
    • Floating-point and money rounding · जल्द आ रहा है
    • Silent merge/join errors and duplicated index values · जल्द आ रहा है
    • A debugging routine: reproduce, isolate, test, fix, prevent · जल्द आ रहा है
  28. C29 Coding Challenges Lab & Assessment अध्याय क्विज़

    • Auto-graded challenge bank (easy / medium / hard) · जल्द आ रहा है
    • Code-review exercises: find the flaw · जल्द आ रहा है
    • Performance challenges: make it 100× faster · जल्द आ रहा है
    • The Python Lab exam: timed practical test · जल्द आ रहा है
    • Portfolio of solved challenges · जल्द आ रहा है
  29. C30 Beyond Python: Other Languages & Tools अध्याय क्विज़

    • R for statistics and time-series; when to prefer it · जल्द आ रहा है
    • Julia, MATLAB and Excel LAMBDA in quant work · जल्द आ रहा है
    • C++ and Rust for low-latency components (overview) · जल्द आ रहा है
    • SQL, DuckDB and notebooks as part of a polyglot workflow · जल्द आ रहा है
    • Calling other languages from Python · जल्द आ रहा है
  30. C27 Python Projects (Capstone for the Section) अध्याय क्विज़

    • Project 1: Download, clean and store daily prices · जल्द आ रहा है
    • Project 2: Returns, risk and correlation dashboard · जल्द आ रहा है
    • Project 3: Moving-average backtest and tear-sheet · जल्द आ रहा है
    • Project 4: Portfolio optimiser with constraints · जल्द आ रहा है
    • Project 5: Options pricer and Greeks calculator · जल्द आ रहा है
    • Project 6: News-sentiment scraper and scorer · जल्द आ रहा है
    • Project 7: Alert bot with scheduling · जल्द आ रहा है
    • Project 8: Mini algo stack (data → signal → paper order → log) · जल्द आ रहा है