# Jacknife

The Jacknife  is also sometimes called the “Leave One Out” method, and is a method to somehow evaluate the stability of statistics done on data. By leaving one element out of the input array and studying the mean of the values, one can identify outliers. Here is a small Python implementation, generalised to “Leave N…

# Seismicity Map and Rate using Basemap and Pandas

Imagine we want to plot a map of the seismic activity in NW-Europe and, at the same time, count the number events per month. To get a catalogue of earthquakes in the region, one can call the NEIC (note: this catalogue contains a lot of different stuff, i.e. quarry blasts, mining-induced events, army-directed WWI&II bombs…

# Matplotlib & Datetimes – Tutorial 04: Grouping & Analysing Sparse Data

To extend the previous tutorial (see here), we define a data array that has some information about the event that occurred for each datetime. The plot of data vs time now looks like: The data array is constructed with numpy.random: data = np.random.randint(10000,size=len(times)) Now, we will modify the example from tutorial 03: def group(di): return…

# Matplotlib & Datetimes – Tutorial 02: Bar Plot

To add some interesting information to the previous tutorial, I’ve downloaded the number of licence plates given for new cars in Belgium for the same time span: 2005 587764 2006 633570 2007 644313 2008 652590 2009 571001 2010 642086 2011 679619 Load them in the same fashion: plates, number = np.loadtxt(‘newplates.txt’,skiprows=1,unpack=True) xdates2 = [datetime.datetime.strptime(str(int(date)),’%Y’) for…

# Matplotlib & Datetimes – Tutorial 01: Fuel Prices

Anyone who has played a little with dates know how painful it can be… Even more when you want to plot this data !! Matplotlib provides (link) a dates API, but to be honnest, even if the documentation is well maintained, I find it confusing. Maybe because they made the choice of a Gregorian-based calendar,…