Python

Python for interactive scientific data visualization

Some random notes on recent ‘pythonic peregrinations’ on my Airbook. Python packages management is really painful. My /Library/Python/2.7/site-packages is just a mess. This is probably due in part to the fact that I switched from easy_install to pip two years ago, but anyway there’s a lot of useless stuff in there. I heard about Bokeh, a new plotting library for Python. Basically, it ought to embed Wilkinson’s Grammar of Graphics into the d3js framework.

Emacs auto-completion for Python

Here are some notes on how to enable auto-completion for Emacs. I already have auto-complete installed and enabled for some major modes. Together with other goodies from ess or yasnippet it really makes life easier when working with R code. Following a recent post by John D Cook, I decided to try to enhance my default Emacs setup for Python (which barely consists in python-mode, ac-python and some custom hooks for indentation and tabs/spaces management).

Interacting with Weka from Jython

I discovered a lovely feature: You can use WEKA directly with Jython in a friendly interactive REPL.

IPython 0.11, the new killer app

IPython 0.11 has just been released. It’s amazing how many new features are now available in this Python “comprehensive environment for interactive and exploratory computing”. Installing on Mac OS X Lion The installation of IPython is simple if you use easy_install. However, to benefit from the new qtconsole, you’ll need to have a working Qt framework and install either PyQt4 or PySide, as documented here. Only the latter worked for me, at the moment.

Installing numpy+scipy on OS X Lion

After a fresh upgrade of my Macbook Air with OS X Lion, I’m left with the default system Python, but nothing of my old stuff in the System Library path. First attempt I first tried to install numpy. The default installed version is 1.5.0, I want the latest version. This was quite simple $ sudo easy_install numpy $ python >>> import numpy >>> print numpy.version 1.6.1 Other easy install: scikit-learn (no dependency, except the above), nose, dexy, ipython.

Python for statistical computing

Pursuant on my previous post on the use of Lisp for statistical computing, here are some links for statistics with Python. Most of the packages listed hereafter have been grabbed on stats.stackexchange.com and MetaOptimize. The two core packages obviously are NumPy and SciPy, which provides infrastructure for handling N-dimensional array object, tools for doing numerical stuff à la Matlab. Combined to Matplotlib, we have a complete scientific numerical platform. The SciPy package already includes some common routines for statistical analysis, but see the Cookbook which collates some worked examples of commonly-done tasks.

Building R 2.12 and Python 3.1 (development snapshot)

Although I already installed the upcoming R 2.11, I decided to build the daily snapshot from scratch, this time not as a Framework version. It suffices to have a look at the configure option to see that… there are many ones! I installed many programs in my /usr/local (in line with ideas coming from Jan de Leeuw), but I never take any note of what I was doing. As a consequence, if I was to reinstall all the 18 Go of programming stuff I put in my /usr/local, it will take me one week again… Hence, I decided to now log on the main install on my Mac.

Testing BioPython

Following my previous posts on Bioinformatics with Mac OS X and Installation of Python scientific packages, I just try the BioPython toolbox. BioPython is an open-source project, based on the same principle as the older BioPerl project.1 It aims at providing a unified interface to traditional methods for computational molecular biology. The question then arises as to whether it conflicts with the Bioconductor or BioPerl initiative. In fact, the Bioconductor project provides a set of about 260 packages (as of July 2008) that enhance the core R software.

How to get scientific Python's packages working on Mac OS X Leopard

I was happy to be able to run all of the greatest of Python’s package for numerical stuff before I moved on Leopard. Since I reinstalled all of my system, I didn’t try to reinstall Python’s packages with the built-in Python (2.5). While I was reading some posts on the web, I feel a little bit desperate about the installation failures that were reported for those using the 2.5 Framework.