[Numpy-discussion] find location of maximum values
Mon Jan 9 22:28:52 CST 2012
On Mon, Jan 9, 2012 at 7:59 PM, questions anon <firstname.lastname@example.org>wrote:
> thank you, I seem to have made some progress (with lots of help)!!
> I still seem to be having trouble with the time. Because it is hourly data
> for a whole month I assume that is where my problem lies.
> When I run the following code I alwayes receive the first timestamp of the
> file. Not sure how to get around this:
You are computing max(axis=0) first. So, tmax is an array containing the
maximum temperature at each lat/lon grid point, over the set of 721 months.
It will be a [106, 193] array.
So the argmax of tmax is an element in a shape [106,193] array (the number
of latitude/number of longitude) not the original three dimension [721,
106, 193] array. Thus when you unravel it you can only get the first time
I re-read your original post but I don't understand what number you need.
Are you trying to get the single max value over the entire array? Or max
value for each month? (a 721 element vector)? or something else?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion