Python

Printer-friendly version

My Swiss army knife of coding tools. Excellent
matrix library, general scientific tools, statistics library,
art tools
interoperation with everything else - wraps C, C++, Fortran, comes
with web servers, HTTP clients, parsers and all the other fruits of a thriving
community.
Fast enough, easy to debug, garbage-collected.
If some bit is too slow, you compile it, otherwise, you relax.
An excellent choice if you’d rather get stuff done than write code.

I do my stats in R, my user interface in javascript, my inner loops in C, but python is the thread that stitches Frankenstein’s monster together.

Pro tips for scientific python

Python version management for weird sciency distributions

use pyenv.

also use virtual env, which can create different projects within a global python version.

ipython

Mathjax offline:

python -m IPython.external.mathjax /path/to/source/mathjax.zip

Basic HTTP server from ipython is unintuitive

greenlets

Concurrency.
For unpredictable asynchrony -
networking, user interactions or any kind of IO there is often an easier option than threads:
greenlets (a.k.a greenthreads/coroutines). I recommend the
gevent package myself, which also monkey patches in some neat concurrency.
No locking woes.

Wacky data structures

Recommendations

  • Software carpentry runs a computer-science- and software-engineering-informed scientific computation course in python.

See original: The Living Thing / Notebooks Python