Diving into Python.
- 1: Language Basics
- 2: Multiparadigmatic programming (imperative, OO, functional)
- 3: Working with data (files, web, JSON)
- 4: Tabular data with Pandas (pandas, csv, plotting)
- How Python views the world
- Language features
- Language Features
- Python I/O and serializations
- Project lifecycle
- Additional Python Topics
- Python data munging
Running Python:
- example web application
Extra:
Examples:
- [notebooks/Pandas/13 Pandas Example - Geolocations.ipynb](notebooks/Pandas/13 Pandas Example - Geolocations.ipynb) (MUKA)
- [notebooks/Pandas/14 Pandas Example - Learning about Weather with DWD.ipynb](notebooks/Pandas/14 Pandas Example - Learning about Weather with DWD.ipynb)
- [notebooks/Pandas/15 Pandas Example - Used Cars.ipynb](notebooks/Pandas/15 Pandas Example - Used Cars.ipynb)
Example (just rendered, data is now 404):
We will look at different contexts:
- many data structures and approaches can be tried out in a REPL
- research, experiments in notebooks
- automating tasks with scripts
- 1991-02-21 (more than 33 years ago, about 19 years after C)
- open source, dynamically typed, interpreted language with a major implementation ("cpython")
- large code fissure between 2006 (PEP-3000) and 2020 ("Sunsetting Python 2")
- de-facto language for the convenience layer in scienfitic computing, on the rise (tiobe), Heise: Und der Sieger ist - Python (2022), blueprint for new developments (like Mojo)
- many popular libraries (top 20 packages are downloaded about 210M per days, or 5.8B times per month, or 2250 "installs" per second)
$ python -c 'import pandas as pd;print(pd.read_html("https://pypistats.org/top")[1][2].sum())'
213946761
$ python -c 'import pandas as pd;print(pd.read_html("https://pypistats.org/top")[3][2].sum())'
5833512800
- Python is a "glue language" - in many ways
- Python has a few downsides ("deployment" and "packaging", requires more discipline in my experience to write robust code)
- 1990s: scripting
- 2000s: scientific computing
- 2010s: data science (also "web")
- 2020s: ML/AI (as a guess)
About 630 KLOC C, plus a standard library of about 900 KLOC Python, plus documentation, tutorials, etc.
===============================================================================
Language Files Lines Code Comments Blanks
===============================================================================
...
C 409 550295 430438 64500 55357
C Header 537 237280 200351 14728 22201
...
Python 1893 912977 736017 59248 117712
ReStructuredText 802 411335 292093 0 119242
...
===============================================================================
Total 4210 2339000 1771030 246934 321036
===============================================================================
- Linux Distributions come with Python installed (on Ubuntu, there is "python-is-python3", cf. AU1296790
- Installation on Windows
- On most linux distributions, you will already have Python installed
- On macOS, there is a homebrew version: https://docs.brew.sh/Homebrew-and-Python