help regarding extracting a smaller list from larger one
gherron at digipen.edu
Thu Sep 15 19:24:15 CEST 2011
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.
> I was curious if anyone is aware of a function in numpy that can
> *extract a smaller list containing numbers from a larger list* given
> the upper and lower limit of the values between which the smaller list
> Thank you in advance.
> Niranjan Kambi
> Senior Research Fellow,
> Neeraj Lab,
> National Brain Research Centre,
> Manesar, Gurgaon-122050
> Haryana, INDIA
> email:- neuro.niru at nbrc.res.in <mailto:neuro.niru at nbrc.res.in>,
> neuroniru at gmail.com <mailto:neuroniru at gmail.com>
Do mean to extract a sub-list from a list based on lower and upper
indexes into the list? Python has a standard notation for indicating
sub-lists, and numpy implements them:
>>> a = numpy.array(range(10))
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
array([3, 4, 5])
If you mean something else, please be more specific, and we'll try again.
Gary Herron, PhD.
Department of Computer Science
DigiPen Institute of Technology
More information about the Python-list