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
pandas.read_csv: how to skip empty lines
Let us suppose that we start with a CSV file that has empty rows: A, B, C 1, 2, 3A, B, C 1, 2, 3 If you read this file with Pandas library, and look at the content of … Continue reading
ipython notebook and matplotlib
In order to have the plots to be shown within a ipython notebook, you should include the following code at the beginning. %pylab inline%pylab inline Images may be tiny. You can set the size by playing with the matplotlib configuration … Continue reading
Python : How to flush output of print
Using the sys module, just type: import sys sys.stdout.flush()import sys sys.stdout.flush()
python argparse issues with the help argument (TypeError: %o format: a number is required, not dict)
Even though Python has a great documentation, once in a while you get stuck on a single problem more than expected. It happenned to me today with the argparse module, which I thought I knew enough to quickly code a … Continue reading
Fourier transformation explained
I love the following image found in this blog.
Pandas dataframe: grouping column by name
Let us consider this data set in CSV format: DIG1, DIG1, DIG1, DIG2 1, 3, 5, 8 2, 4, 6, 9 3, 5, 7, 10DIG1, DIG1, DIG1, DIG2 1, 3, 5, 8 2, 4, 6, 9 3, 5, 7, 10 … Continue reading
Starting to use Python Pandas library
Pandas is brilliant. If you are looking to manipulate data in Python, use it. I am refactoring most of my codes with this library. It provides many useful data structures to manipulate data in 2, 3, 4 dimensions and more. … Continue reading
Reading Nikkon Raw image with Gimp plugin UFRaw
I recently started to play with RAW images on a Nikkon camera. The first issue was that gimp could open the images but only in a kind of thumbnail version. Browsing around it looks like one tool to read the … Continue reading
pandas import fails with ImportError: cannot import name hashtable
Import of pandas raises the following error: ImportError: cannot import name hashtableImportError: cannot import name hashtable Starting a python session, I typed from pandas import hastablefrom pandas import hastable and got this new message: ImportError: cannot import name hashtableImportError: cannot … Continue reading
Line starting ‘ …’ is malformed! error
Playing with a Python wrapper of an R package, I suddenly got this error after a trivial change of the code: Line starting ‘<!DOCTYPE html> …’ is malformed!Line starting ‘<!DOCTYPE html> …’ is malformed! Wondering for a couple of minutes … Continue reading