Re: [Numpy-discussion] find location of maximum values

2012-01-09 Thread questions anon
Thank you, thank you, thank you! I needed to find the max value (and corresponding TIME and LAT, LON) for the entire month but I shouldn't have been using the tmax, instead I needed to use the entire array. Below code works for those needing to do something similar. Thanks for all your help everyon

Re: [Numpy-discussion] find location of maximum values

2012-01-09 Thread Aronne Merrelli
On Mon, Jan 9, 2012 at 7:59 PM, questions anon 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 alwa

Re: [Numpy-discussion] find location of maximum values

2012-01-09 Thread Olivier Delalleau
Do you mean that listval[0] is systematically equal to 0, or is it something else? -=- Olivier 2012/1/9 questions anon > 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 t

Re: [Numpy-discussion] find location of maximum values

2012-01-09 Thread questions anon
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 ge

Re: [Numpy-discussion] find location of maximum values

2012-01-09 Thread Benjamin Root
On Monday, January 9, 2012, questions anon wrote: > thanks for the responses. > Unfortunately they are not matching shapes print TSFC.shape, TIME.shape, LAT.shape, LON.shape > (721, 106, 193) (721,) (106,) (193,) > > So I still receive index out of bounds error: tmax=TSFC.max(axis=0) > nu

Re: [Numpy-discussion] find location of maximum values

2012-01-09 Thread questions anon
thanks for the responses. Unfortunately they are not matching shapes >>> print TSFC.shape, TIME.shape, LAT.shape, LON.shape (721, 106, 193) (721,) (106,) (193,) So I still receive index out of bounds error: >>>tmax=TSFC.max(axis=0) numpy array of max values for the month >>>maxindex=tmax.argmax()

Re: [Numpy-discussion] filling an alice of array of object with a reference to an object that has a __getitem__ method

2012-01-09 Thread Olivier Delalleau
Oh, sorry, I hadn't paid enough attention to the way you are indexing A: if you are using an array to index, it creates a copy, so using ".fill" will fill the copy and you won't see the result. Instead, use A[0:3], A[3:6], etc. -=- Olivier 2012/1/9 "David Köpfer" > Hi Oliver, > > thank you ver

Re: [Numpy-discussion] filling an alice of array of object with a reference to an object that has a __getitem__ method

2012-01-09 Thread David Köpfer
Hi Oliver, thank you very much for your reply, sadly it is not working as you and I hoped. The array still stays at None even after the code. I've also tried A[X] = [MyObject(...)]*len(X) but that just results in a Memory error. So is there really no way to avoid this broadcasting? David -