A long time ago, I posted a simple template for writing text-processing Unix utilities in Python. Since we're not in 2009 anymore, I figured it's time to port it to Python 3.
Differences between the old 2.5 compatible version is the use of argparse instead of optparse (which is …
A while ago we plotted time series data with Matplotlib. This worked nicely, but with the data at hand, a bar diagram would have looked much better. In this article I'll give you a template for using bar diagrams with time series data. This builds on the work we did …
Recently I rediscovered Bottle, a Python-based micro framework for web applications. Bottle gives you full control over your URLs, has a simple built-in templating engine and a lot of other commonly used stuff. It takes you five minutes to get started and perhaps one hour with its great documentation to …
I've been playing with scikit-learn recently, a machine learning package for Python. While there's great documentation on many topics, feature extraction isn't one of them. My use case was to turn article tags (like I use them on my blog) into feature vectors.
It's been a while since my last article on Matplotlib. Today we're going to plot time series data for visualizing web page impressions, stock prices and the like over time.
If you haven't already, install Matplotlib (package python-matplotlib on Debian-based systems) and fire up a Python interpreter. For the rest …
Yesterday, I was quite surprised when I head rumors that Delicious, my favorite link sharing site, is shutting down. According to their blog, they are looking for a way to continue the service outside of Yahoo, but it's better to be safe than sorry and backup all bookmarks.
Sometimes I need a simple stop watch in my Python scripts to find out how expensive my code is in wall clock time. The problem is trivial to solve, but I thought I'd give it a try using Python's with statement and a context manager.
For a long time, Gnuplot has been my tool of choice for plotting diagrams. The diagrams it produces out of the box look very scientific, but it takes a lot of tweaking to produce something that's visually pleasing. I got used to Gnuplot's weird ways but I was never entirely …