Author Archives: Thomas Cokelaer

corrplot function in Python

We’ve implemented a corrplot function in Python, which is available in BioKit package – github https://github.com/biokit/biokit – pypi https://pypi.python.org/pypi/biokit For illustration, let us create some random data sets: import pandas as pd import string letters = string.uppercase[0:15] df = pd.DataFrame(dict(( … Continue reading

Posted in Python | Tagged , , , | 4 Comments

About matplotlib colormap and how to get RGB values of the map

matplotlib comes with lots of colormaps. First, let us see where and how to find them. Then, we will see how to extract individual colors (e.g., in RGB) from the colormap itself. Let us first creat an image from matplotlib … Continue reading

Posted in Python | Tagged | 1 Comment

git and github : skip password typing with ssh

Assuming you have already provided your ssh key in your github settings, you can avoid typing your username and password when when pushing content into your github account, by cloning the SSH repository instead of the default HTTP one. ssh://git@github.com/username/repo.gitssh://git@github.com/username/repo.git … Continue reading

Posted in Computer Science | Tagged | Leave a comment

Installing Python2.6 in a virtual environment

First, install python2.6 executable. see previous post if you have issues when compiling (gcc not found). Make sure you have installed python-dev with apt-get or yum. Then, following the instructions on the same topic but for Python 3 in a … Continue reading

Posted in Python, Software development | Tagged , | 2 Comments

Installation of Python 2.6 error fixed

I wanted to install python2.6 in a virtual environment. The first step was to compile python 2.6 executable from the source code. Once the source are extracted, just type: ./configure –prefix=<PATH_WHERE_TO_INSTALL> make./configure –prefix=<PATH_WHERE_TO_INSTALL> make If you are lucky, everything is … Continue reading

Posted in Python | Tagged , | 11 Comments

Installing another Python version into virtualenv

The idea is that we do not want to install a new version of Python on the system (e.g., for testing purpose), which may interfere with your entire distribution. Instead, we want to create a virtual environment with virtualenv tool. … Continue reading

Posted in Python, Software development | Tagged | 6 Comments

How to add badges in your pypi project

1. pypi badge To get the pypi badge, go to https://badge.fury.io/for/py page and enter the name of a valid package. Select the code you’d like to insert into your documentation (e.g., RST) and you check get a image like this: … Continue reading

Posted in Python | 3 Comments

Migrating from a Subversion repository to GitHub

I’ve just moved a SVN repository to github. I was a bit afraid of spending time and lost the history but fortunately, I came upon this great post http://www.samaxes.com/2013/11/move-from-svn-to-git/ , followed the instructions and it worked almost like a charm. … Continue reading

Posted in Uncategorized | Leave a comment

How to calculate mean in AWK

Another trick with awk to compute mean of a column. Imagine that you have a file with many lines and you want to compute the mean of the fourth item on each line. E.g: Lowest value found .2 Lowest value … Continue reading

Posted in Linux | Tagged | Leave a comment

How to send svn diff to meld

On one hand meld provides a nice GUI to visualise the differences between 2 files. On the other hand, with SVN diff command, you can obtain the differences between 2 versions of the same file so you end up with … Continue reading

Posted in Linux | Tagged , | 7 Comments