Category Programming

Go, go, go

I’ve decided to learn Go. Not the board game, but the programming language. Why? I’ve been wanting to learn a systems programming language for a while, but have so far avoided picking up my brick of a C++ manual.

Using the Python debugger

A few days ago I found out that using the Python debugger is so easy, I can’t believe I haven’t used it before. Import the module: import pdb Set a breakpoint somewhere in your code: def some_function(self, x, y, z):…

Clustering in Python

In a project I’m going to use clustering algorithms implemented in Python, such as k-means. Clustering scipy.cluster has been reported to have some problems, so for now I’ll use PyCluster (following advice given on stackoverflow). Install PyCluster: pip install…

Python: inverse of zip

So you have a list of tuples, created with the zip built-in function in Python. Like this: z = [(1, ‘a’), (2, ‘b’), (3, ‘c’)] And you want to reverse zip, to get these two lists: x = [1, 2,…

Plotting data on maps with matplotlib

I’m learning about matplotlib, and actually just bought the book Matplotlib for Python Developers. Geographical plots Browsing stackoverflow, the matplotlib homepage, and other resources, I eventually came by this stackoverflow post, which mentions BaseMap. Since the data that I’m plotting…