Re: [Numpy-discussion] Help with np.where and datetime functions

2009-07-08 Thread Robert Kern
On Wed, Jul 8, 2009 at 19:11, John [H2O] wrote: > > Also, could someone please explain why: > > Tsub = T[ (T[:,0]>t1) & (T[:,0] > Works, but: > > Tsub = T[ (t1 > Does not??? I'm not positive, but I think it boils down to this: Python tries to look up the method from the first operand before the se

Re: [Numpy-discussion] Help with np.where and datetime functions

2009-07-08 Thread John [H2O]
Also, could someone please explain why: Tsub = T[ (T[:,0]>t1) & (T[:,0]http://www.nabble.com/Help-with-np.where-and-datetime-functions-tp24389447p24401687.html Sent from the Numpy-discussion mailing list archive at Nabble.com. ___ NumPy-Discussion mail

Re: [Numpy-discussion] Help with np.where and datetime functions

2009-07-08 Thread John [H2O]
nhmc wrote: > > > > Also, if you don't need the indices, you can just use the conditional > expression as a boolean mask: > condition = (t1 < Y[:,0]) & (Y[:,0] < t2) Y[:,0][condition] > > Neil > 'condition' is not an index array? Wouldn't it just be the indices as well? Would i

Re: [Numpy-discussion] Help with np.where and datetime functions

2009-07-08 Thread John [H2O]
Pierre GM-2 wrote: > > > > Would you like to give the scikits.timeseries package a try ? It's > available at pytseries.sourceforge.net. > Calculatng the hourly average should be straightforward. > I would, in fact I have been investigating it, but I didn't have numpy1.3 up and running unti

Re: [Numpy-discussion] Help with np.where and datetime functions

2009-07-08 Thread Pierre GM
On Jul 8, 2009, at 7:03 AM, John [H2O] wrote: > > Hello, > > I have several issues which require me to iterate through a fairly > large > array (30+ records). > > The first case is calculating and hourly average from non-regularly > sampled > data. Would you like to give the scikits.time

Re: [Numpy-discussion] Help with np.where and datetime functions

2009-07-08 Thread Neil Crighton
John [H2O] gmail.com> writes: > What I am trying to do (obviously?) is find all the values of X that fall > within a time range. > > Specifically, one point I do not understand is why the following two methods > fail: > > --> 196 ind = np.where( (t1 < Y[:,0] < t2) ) #same result > with/

[Numpy-discussion] Help with np.where and datetime functions

2009-07-08 Thread John [H2O]
Hello, I have several issues which require me to iterate through a fairly large array (30+ records). The first case is calculating and hourly average from non-regularly sampled data. The second is screening one array, based on data in the second array. The functions are defined below, but in