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

Robert Kern robert.kern at gmail.com
Wed Jul 8 20:33:17 EDT 2009


On Wed, Jul 8, 2009 at 19:11, John [H2O]<washakie at gmail.com> wrote:
>
> Also, could someone please explain why:
>
> Tsub = T[ (T[:,0]>t1) & (T[:,0]<t2) ]
>
> Works, but:
>
> Tsub = T[ (t1<T[:,0]) & (T[:,0]<t2) ]
>
> 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 second operand.
TimeSeries know about datetime objects, but datetime objects don't
know about TimeSeries.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco



More information about the NumPy-Discussion mailing list