Steven D'Aprano REMOVE.THIS.cybersource.com.au> writes:
> >
> > operandlist1=[1,2,3,4,5]
> > operandlist2=[5,4,3,2,1]
> >
> > and resultlist will become [6,6,6,6,6]. Using map(), I can do:
> >
> > map(lambda op1,op2: op1 + op2, operandlist1, operandlist2)
>
> If the two lists are very large,
You can join all your arrays into a single big array with concatenate.
>>> import numpy as np
>>> a = np.concatenate(array_of_arrays)
Then count the number of occurrances of each unique element using this trick
with searchsorted. This should be pretty fast.
>>> a.sort()
>>> unique_a = np.unique(
Dhananjay gmail.com> writes:
> I want to sort the data on the basis of 3rd column first and latter want to
> sort the sorted data (in first step) on the basis of 6th column.I tried
> sort() function but could not get the way how to use it.I am new to
> programming, please tell me how can I sor
Carl Banks gmail.com> writes:
> > >>> condition = (min_time <= time) & (time <= max_time)
> > >>> new_time = time[condition]
> > >>> new_energy = energy[condition]
>
> Won't work: condition is an array of ones and zeros, but you need to
> index the arrays with indices. So, add a call to nonzero
heidi taynton mac.com> writes:
>
> Hi,
>
> I'm fairly new to programming and am having a probably cutting my arrays. I
have two different 1d arrays, one
> of time, and the second energy.I want to cut both arrays of time
min<=time<=max . I've created a 2d array
> with [time,energy] an
I'm using the zipfile library to read a zip file in Windows, and it
seems to be adding too many newlines to extracted files. I've found
that for extracted text-encoded files, removing all instances of '\r'
in the extracted file seems to fix the problem, but I can't find an
easy solution for binary