Analyzing atmospheric pressure in De Bilt

Atmospheric pressure is the pressure exerted by air in the atmosphere. It is defined as force divided by area. The KNMI De Bilt data file has measurements in 0.1 hPa for average, minimum, and maximum daily pressures. We will plot a histogram of the average pressure and monthly minimums, maximums, and averages:

  1. We will load the dates converted to months, average, minimum, and maximum pressure into NumPy arrays. Again, missing values needed to be converted to NaNs. The code is as follows:
    to_float = lambda x: 0.1 * float(x.strip() or np.nan) to_month = lambda x: dt.strptime(x, "%Y%m%d").month months, avg_p, max_p, min_p = np.loadtxt(sys.argv[1], delimiter=',', usecols=(1, 25, 26, 28), unpack=True, converters={1: ...

Get Learning NumPy Array now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.