Modernpython
Sample code for the video course: Modern Python: Big Ideas, Little Code
Install / Use
/learn @rhettinger/ModernpythonREADME
Modern Python: Big ideas, Little Code
This code is offered as an accompaniment to a Python Video course by Raymond Hettinger.
See Modern Python: Big Ideas, Little Code.
Raymond runs an international Python training and consulting company and is available for basic, intermediate, and advanced python training.
Getting Setup
-
Install Python 3.6.1 or later from https://www.python.org
-
Setup and activate a virtual environment:
$ python3.6 -m venv modernpython
$ source modernpython/bin/activate
- Install the packages used in the examples:
(modernpython) $ pip install pyflakes
(modernpython) $ pip install bottle
(modernpython) $ pip install pytest
(modernpython) $ pip install hypothesis
(modernpython) $ pip install mypy
Resampling
This code demonstrates simulations, resampling, bootstrapping, hypothesis testing, and estimating confidence intervals.
Machine Learning
The kmeans.py file implements k-means from scratch. The
congress_data directory has CSV files with the voting histories
of senators in the 114th U.S. Congress. The congress.py file
demonstrates ETL (extract-transfrom-load) and unsupervised
machine learning (k-means) to analyze the voting clusters.
Publisher Subscriber
This code implements a simple publisher-subscriber notification
service. The pubsub.py implements the data model and core
services. The session.py loads sample data. The webapp.py
file runs a webserver for the application. The views directory
has the Bottle templates and the static directory has the
static resources (icons and photos).
To start the service, run:
(modernpython) $ python webapp.py
Then point your browser to http://localhost:8080/
The login information is in the session.py file.
Testing
The quadratic.py file is a module with a simple function to
demonstrate various approaches to testing included in
test_quadratic.py.
Validation
The pricing_tool.py file is used to demonstrate the descriptor
based data validation tools in validators.py
Related Skills
qqbot-channel
348.5kQQ 频道管理技能。查询频道列表、子频道、成员、发帖、公告、日程等操作。使用 qqbot_channel_api 工具代理 QQ 开放平台 HTTP 接口,自动处理 Token 鉴权。当用户需要查看频道、管理子频道、查询成员、发布帖子/公告/日程时使用。
docs-writer
100.3k`docs-writer` skill instructions As an expert technical writer and editor for the Gemini CLI project, you produce accurate, clear, and consistent documentation. When asked to write, edit, or revie
model-usage
348.5kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
Design
Campus Second-Hand Trading Platform \- General Design Document (v5.0 \- React Architecture \- Complete Final Version)1\. System Overall Design 1.1. Project Overview This project aims t
