RE: help regarding extracting a smaller list from larger one

2011-09-15 Thread Prasad, Ramit
>Nevertheless, I think list comprehension is what you want: > [ x for x in A if 3.0 <= x <= 8.0 ] >will extract all the values between 3 and 8 from the array A and create >a new list containing them. >If you want the new list to be a numpy array then > numpy.array([ x for x in A if 3.

Re: help regarding extracting a smaller list from larger one

2011-09-15 Thread Gary Herron
On 09/15/2011 11:55 AM, neeru K wrote: Dear Gary, thank you for the reply. I will be more specific and take the same example that you have given and tell you what is my problem - array([0.0, 1.3, 2.45, 3.87, 4.54, 5.11, 6.90, 7.78, 8.23, 9.01]) from this array I want to a sub-list with lower an

Re: help regarding extracting a smaller list from larger one

2011-09-15 Thread neeru K
Dear Gary, thank you for the reply. I will be more specific and take the same example that you have given and tell you what is my problem - array([0.0, 1.3, 2.45, 3.87, 4.54, 5.11, 6.90, 7.78, 8.23, 9.01]) from this array I want to a sub-list with lower and upper indexes that are not present in the

Re: help regarding extracting a smaller list from larger one

2011-09-15 Thread Gary Herron
On 09/15/2011 09:40 AM, neeru K wrote: Dear Python Users, I am trying to write a code for visualization (raster plots and peri-event time histogram) of time series electrophysiological data using numpy, scipy and matlplotlib in python. I am importing the data into list using loadtext command.

help regarding extracting a smaller list from larger one

2011-09-15 Thread neeru K
Dear Python Users, I am trying to write a code for visualization (raster plots and peri-event time histogram) of time series electrophysiological data using numpy, scipy and matlplotlib in python. I am importing the data into list using loadtext command. I was curious if anyone is aware of a functi