I am using the metpy package to calculate many different weather parameters for many different locations across North America for many different hours. I want to fill arrays containing these weather parameters that look like: [hrs,stns]. I am not able to vectorize these operations, unfortunately (see metpy package documentation and notice that many of these calculations cannot operate on the original arrays this data normally comes in).
Here is a very simple example of my code. How would I run the following code in parallel?
wx_array1 = np.empty(shape=(3000,600))
wx_array2 = np.empty(shape=(3000,600))
for hr in range(3000):
for stn in range(600):
wx_array1[hr,stn] = hr * stn
wx_array2[hr,stn] = hr + stn
np.outerfor example.wx_array1/2are a numpy arrays andhrandstnare integers. If you're not working with numpy arrays and integers, then your question, which only contains numpy arrays and integers, is clearly not representative (that's what I have been trying to say all along).