I have a numpy array what contains data of m/s wind speed. Both negative and positive values. Now i need to calculate the average number of the wind speed over the negative values and do the same for the positive values. Is this possible ? It's important that the data stays in the array. I had tryed something with numpy.average but without success, as he takes the average of the whole array both positive and negative values.
Thank you!
The nice thing about numpy is that you can write things like:
negavg = numpy.mean(windspeed[windspeed < 0.0])
posavg = numpy.mean(windspeed[windspeed > 0.0])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With