Skip to main content

13.3) Exercise 36 - Array Operations


Write a function that calculates the wind speed from 2D wind vectors u and v.
Test your function on wind vectors generated randomly (for example try using a normal distribution with numpy.random.normal()).
Does your function work on 1D or 3D wind fields?
Hint: If you use array operations rather than looping over the elements of the array, your function will work for arrays of any shape as long as u and v are the same size.
Solution: Np_wind_speed.py