[SciPy-User] Finding if Entries of an Array Are Within Time Windows

Lorenzo Isella lorenzo.isella at gmail.com
Tue Sep 8 12:32:15 EDT 2009


Dear All,
Please consider the arrays:

A=[12,23,98,34,123,9]

and

B=[22,34
      40,43
      68, 98
      102,123]
   
Array A stands for the times when certain observations are recorded, 
whereas the raws of B are time-windows.
I need to select the entries of A according to this rule: if A[i] falls 
within the time-periods given by B, then I'll keep it, otherwise I'll 
discard it.
The aim is to trim the array A by getting rid of all the entries which 
do not fall within any time-window given by B.
Any suggestions about how to achieve that?
Many thanks

Lorenzo



More information about the SciPy-User mailing list