In [1]:
import numpy as np

In [2]:
data = np.load('monthdata.npz')
totals = data['totals']
counts = data['counts']

In [5]:
totals_annual = np.sum(totals, axis=1)
min_total_annual = np.argmin(totals_annual)
print("Row with lowest total preciptiation:")
print(min_total_annual)


Row with lowest total preciptiation:
8

In [6]:
prep_average = np.sum(totals, axis=0)/np.sum(counts, axis=0)
print("Average precipitation in each month:")
print(prep_average)


Average precipitation in each month:
[ 27.77978339  30.42629482  29.41007194  17.96654275  21.34456929
  20.69498069  24.97718631  19.85661765  24.06563707  44.68441065
  34.61568627  32.36679537]

In [7]:
place_daily_average = np.sum(totals, axis=1)/np.sum(counts, axis=1)
print("Average precipitation in each city:")
print(place_daily_average)


Average precipitation in each city:
[ 47.77859779  14.33333333  39.91232877  41.44505495  23.4099723
  23.68144044  17.52197802  36.52222222   6.15426997]

In [8]:
totals_quarterly = np.reshape(totals, (totals.shape[0],4,3))
totals_quarterly_sum = np.sum(totals_quarterly, axis=2)
print("Quarterly precipitation totals:")
print(totals_quarterly_sum)


Quarterly precipitation totals:
[[5450 1408 1466 4624]
 [ 189 1339 3148  527]
 [3120 3357 3386 4705]
 [4416 3321 2024 5325]
 [2024 1498 1721 3208]
 [1786 1809 2557 2397]
 [1583 1296 1729 1770]
 [4602 1340 1250 5956]
 [ 338  524  922  450]]