O'Reilly logo

NumPy Cookbook - Second Edition by Ivan Idris

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Studying intrayear average pressure

It's interesting to explore the atmospheric pressure within a year. In particular, it may be informative to check for patterns related with variability, and therefore, predictability. The reason is that atmospheric pressure in some months can vary much, and reduce predictability. In this recipe, we will plot monthly box plots and monthly variance of atmospheric pressure.

The recipe code is in the intrayear.py file in this book's code bundle. Please pay extra attention to the highlighted sections:

import numpy as np import matplotlib.pyplot as plt import calendar as cal data = np.load('cbk12.npy') # Multiply to get hPa values meanp = .1 * data[:,1] # Get months dates = data[:,0] months = (dates % 10000)/100 monthly ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required