Month: June 2012

NumPy beginner’s guide: Date formatting, stock quotes and Wikipedia sentiment analysis

Posted on Updated on


Last year I acted as one of the reviewers on a book from Packt Publishing: The NumPy 1.5 Beginner’s Guide (ISBN 13 : 978-1-84951-530-6) about the numerical programming library in the Python programming language. I was “blinded” by the publisher, so I did not know that the author was Ivan Idris before the book came out. For my reviewing effort I got a physical copy of the book, an electronic copy of another book and some new knowledge of certain aspects of the NumPy.

One of the things that I did not know before I came across it while reviewing the book was the date formatter in the plotting library (matplotlib) and the ability to download stock quotes via a single function in the NumPy library (there is an example starting on page 171 in the book). There is a ‘candlestick’ plot function that goes well with the return value of the quotes download function.

The plot shows an example of the use of date formatting with stock quotes downloaded from Yahoo! via NumPy together with sentiment analysis of Wikipedia revisions of the Pfizer company.

An image of obsolescence

Posted on Updated on


An image of obsolescence: Four empty telephone booths.

(As seen on a hotel in Crete)

Caught red-and-white-handed

Posted on Updated on


Denmark is on the front page of English Wikipedia today as it is constitution day (5 June). In connection with writing on Wikipedia I ran into paragraph 57. It reads “No member of parliament can without its consent be prosecuted or subjected to imprisonment of any kind, unless he is caught in flagrante dilicto”.

There are a number of strangenesses in the Danish constitution and this sentence is among them. Why should there be a condition on “caught in flagrante dilicto” (red-handed)? And when are you red-handed? What exactly does it mean? Do you need to be in the process of stealing to be red-handed or is it enough to just be in the process of publishing information which are illegal to publish? Or drunk-driving?

Former minister of justice Lene Espersen once had a traffic accident. As she herself contacted the police I suppose you could say that she caught herself red-handed… Nevertheless the parliament was involved to release her parliamentary immunity.

Another thing that bothers me a bit with the sentence is the possesive adjective “its”: it refers to “parliament”, but could be confused with with a reference to “member”.

(Photo by Per Palmkvist Knudsen, CC-BY-SA)