A structured, hands-on reference repository covering core Python concepts and foundational AI/ML topics. This repository is intended to serve as a learning resource for developers who want to strengthen their Python fundamentals with clear, well-commented examples in both interactive notebooks and standalone scripts.
- Overview
- Prerequisites
- Getting Started
- Repository Structure
- Topics Covered
- Running the Notebooks
- Running the Scripts
- License
This repository is organized into two primary components:
notebooks/— Interactive Jupyter notebooks grouped by topic, ideal for step-by-step exploration.src/— Standalone Python scripts demonstrating concepts in a production-style format.
Each topic is self-contained and can be studied independently.
- Python 3.10 or higher
pip(Python package manager)- JupyterLab (installed via
requirements.txt)
git clone https://github.com/aneeb02/python-ai-ml.git
cd python-ai-mlLinux / macOS:
python3 -m venv venv
source venv/bin/activateWindows:
python -m venv venv
venv\Scripts\activatepip install -r requirements.txtpython-ai-ml/
│
├── notebooks/ # Interactive Jupyter notebooks
│ ├── 01_python_basics/ # Core syntax, functions, scope, operators
│ ├── 02_data_structures/ # Lists, comprehensions, built-in structures
│ ├── 03_advanced_python/ # OOP, decorators, generators, memory management
│ ├── 04_concurrency/ # Async, multithreading, multiprocessing
│ ├── 05_design_patterns/ # Dependency injection, generator pipelines
│ └── 06_ai-ml-intro/ # NumPy, introductory ML concepts
│
├── src/ # Standalone Python scripts
│ ├── advanced_python/ # Context managers, descriptors, monkey patching
│ ├── design_patterns/ # Factory pattern, dependency injection
│ ├── ipc/ # Inter-process communication (pipes, queues, shared memory)
│ └── mini_projects/ # Small self-contained programs (Mastermind, Password Generator)
│
├── data/ # Sample datasets and input files
├── docs/ # Reference documents and supplementary reading
├── logs/ # Runtime log output (not tracked by git)
│
├── requirements.txt # Python dependencies
├── .gitignore # Git ignore rules
└── README.md # Project documentation
- Variables, operators, and control flow
- Functions, scope, and closures
- Exception handling and file I/O
- Lists, tuples, sets, and dictionaries
- List and dictionary comprehensions
- Stacks, queues, and linked list implementations
- Object-Oriented Programming: inheritance, dunder methods, descriptors
- Decorators (function and class-based)
- Generators and iterators
- Memory management and garbage collection
- Copy mechanisms: assignment, shallow, and deep copy
- Regular expressions
asyncioand asynchronous programming- Multithreading with the
threadingmodule - Multiprocessing with the
multiprocessingmodule - Inter-Process Communication (IPC): pipes, queues, shared memory
- Factory Pattern
- Dependency Injection
- Generator Pipelines
- NumPy arrays and operations
- Introductory machine learning concepts with
scikit-learn
Start JupyterLab from the project root:
jupyter labNavigate to the notebooks/ directory in the JupyterLab file browser and open any .ipynb file.
Note: Notebooks that read from files (e.g.,
file_handling.ipynb,generator_pipeline.ipynb) use relative paths that assume JupyterLab is launched from the project root directory.
Scripts are standalone and can be run directly from the project root:
python3 src/mini_projects/password_gen.py
python3 src/mini_projects/mastermind.py
python3 src/ipc/ipc_shared_memory.pyIf you feel anything is missing or some concept can be added or further explained, feel free to contribute!