Monthly Archives: June 2014

Pandas : how to compare dataframe with None

While comparing a pandas dataframe with None, import pandas as pd df = pd.DataFrame() # Note that the dataframe is empty but it does not matter for this example. if df == None: pass # do nothing else: df.describe()import pandas … Continue reading

Posted in Python | Tagged | 4 Comments

pygame installation not working due to “linux/videodev.h: No such file or directory” error

I wanted to install the python package called pygame. I encountered quite a few issues before being able to install it. I’m reporting here some of the solutions. Before starting, keep in mind that you can install pygame using apt-get … Continue reading

Posted in Python | Tagged | Leave a comment

perl: define a module to be called in another script

First, define a module. The module must be in a path reachable by perl (e.g., local directory). Then, to make a script a valid package, you need to proceed as follows: Rename the perl script with the extension .pm It … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

sed: how to add text at the end of the file

Use the $a syntax and sed: sed -i ‘$a some text’ filenamesed -i ‘$a some text’ filename -i parameter means in place. To test without changing the original file, remove the -i option. The results will be print on the … Continue reading

Posted in Linux | Tagged | 2 Comments