Follow me
-
Recent Posts
calendar
December 2024 M T W T F S S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Recent Comments
- Stan on python argparse issues with the help argument (TypeError: %o format: a number is required, not dict)
- Cormac on Pandas : how to compare dataframe with None
- LP on AWK: the substr command to select a substring
- jrab on python argparse issues with the help argument (TypeError: %o format: a number is required, not dict)
- How to disable SSL verification for urlretrieve? – Peter's blog on python: certificate verified failed
Archives
Categories
Meta
Author Archives: Thomas Cokelaer
matplotlib: latex strings are not interpreted
If the LaTeX strings are not intepreted in matplotlib (e.g., in the xlabel), check your configuration file ( see previous post for matplotlib configuration file). You can either do it for one session : rc(’text’, usetex=True) plot([1,2],[3,4]); title(’a^2’) rc(‘text’, usetex=True) … Continue reading
Matplotlib configuration
Note 4/Sept/2013: the new location is /home/user/.config/matplotlib If you have ipython, try this command ipython -pylabipython -pylab and if you have Qt, you can change the backend (library used for plotting) and use qt as follows: ipython -pylab qtipython -pylab … Continue reading
Fitting distribution by combing R and Python
The following example illustrates how to use R package with Python by using the Rpy2 package. This problem solve in this example is to fit a normal distribution on some data samples. from rpy2.robjects import r from rpy2.robjects.packages import … Continue reading
Profiling in Python
Lot of information is available in the Python documentation website: http://docs.python.org/library/profile.html . However, here is a small snapshot of how to use it : Let us say you have a function call test(). First you need to run it: import … Continue reading
vim: replace the windows ^M character under Linux
Within VIM, there is a way to replace all the return carriage from Windows (that appear as ^M) by replacing them with the Linux version: % s/^M/\r/g% s/^M/\r/g When \r stands for the return carriage in Linux (not \n as … Continue reading
SVN: How to revert (roll back) to a previous version ?
One reason to use SVN tool is to be able to revert to a previous version. How do we do that ? Imagine that the latest version (the one on the HEAD) is not what you want anymore, but that … Continue reading
running PHP from Command Line Shell
If you want to test some PHP code without using the browser interface, you can create a script to use command line shell as follows. Let us call this script scripting.php. Under Linux, create this file with the php extension … Continue reading
R: how to use command line arguments from R scripts
If you want to script R with arguments, you can type (under a Linux shell): R –no-restore –no-save –args 10 < script.RR –no-restore –no-save –args 10 < script.R where –args is a list of arguments that you want to use … Continue reading
Fedora 15 : Firefox drag and drop does not work
The solution is to install gtk2-engines package: sudo yum install gtk2-engines.i686sudo yum install gtk2-engines.i686