Table of Contents
Python is a general purpose high-level language. I decided to learn it to augment R as it has excellent web-scraping tools, machine learning and even has a several web-development frameworks such as Django.
Topics
- Emacs Setting up and configure your favourite text editor for development.
Packages
There are a lot of packages for Python, what you install will depend highly on what you wish to do. As I mainly do data science, statistics, automated reporting and attempt to do so in a computer science framework these are the packages that I use regularly.
My requirements.txt
file can be found here. When creating a new virtual environment install all packages with…
- snippet.bash
pip install -r requirements.txt
Packages can be given aliases when they are imported, some common packages have common abbreviations…
- snippet.python
import numpy as np import matplotlib.pyplot as plt import pandas as pd
Upgrading
Pip doesn't have a flag to automatically upgrade everything (at least according to this thread) but a suggested solution is to…
- snippet.bash
❱ pip list --outdated --format=json | jq -r '.[] | .name' | xargs -n1 pip install -U
Tips and Tricks
Fun
- Seagull a library for simulating Conways Game of Life.
Packages Specific Pages
Standard Library
Data Management
Graphics
- altair a grammar of graphics like declarative plotting package in Python.
- bokeh for interactive plots (zooming etc.)
- cufflinks for adding sparkle to Plotly graphs.
- folium for embedding maps.
- Matplotlib base plotting.
- Plotly Making graphs fancy interactive graphs.
- plotnine a grammar of graphics for Python (viz. ggplot2 for Python)
- Seaborn preconfigured plots/themes for matplotlib
GIS
- OSRM Python interface to the Open Source Routing Machine
Jupyter
Statistics
Testing and Linting
Reporting
HTML
- Pelican static website generator that parses Markdown.
My projects
Bandcamp Library
I decided to write a library/program for managing Bandcamp.
tpx2gpx
I needed to convert GPS traces recorded by Endonmondo which exports as Garmin TPX files to the more generic GPX format for importing into OpenTrack (I'd decided I wanted more privacy whilst recording my running and cycling). I therefore wrote tpx2gpx
to do this and took the opportunity to learn a bit about CD/CI (Continuous Development/Continuous Integration) on GitLab and how to release packages to PyPi.
Weston Park Weather
Scraping data on weather from @WPWeather a weather station in Weston Park, Sheffield.
AirQuality
I have an Air Quality monitor outside of my house and wanted to play around with the data myself, to which end I started (but haven't yet finished) writing a package to grab the data from Luftdaten and store it in a MongoDB in their Atlas Cloud service.
Links
- Reticulate an R interface to Python.
- [PEP8 – Style Guide for Python Code]www.python.org/dev/peps/pep-0008/)
Numpy
Statistics
Learning
- Chris Albon - Python - A lot of useful examples for Python and many other statistics/machine learning/data science topics.
Kids
Books
Podcasts
Blog Articles
Software Development
Deployment
Programming
- Stop Using datetime.now! | Haki Benita and exposition of Dependency Injection which allows decoupling of methods/functions.
Refactoring
SOLID
Statistics
History
python:python programming datascience computerscience