[Numpy-discussion] Numpy array performance issue
Thu Feb 25 10:20:57 CST 2010
This is the same example we discuss yesterday.
The working code is this one:
lsPhasedValues = [aLoci[i] for i in xrange(length) if i%21==0 and
I was able to get the same result after a while:
lsPhasedValues = numpy.unique1d(aAux[numpy.where(aAux>0)])
I couldn't came up with a better solution.
Thank you in advance,
2010/2/25 Robert Kern <email@example.com>
> On Thu, Feb 25, 2010 at 07:51, Bruno Santos <firstname.lastname@example.org> wrote:
> > I just realized that the line lsPhasedValues =
> > numpy.unique1d(aLoci[numpy.where(aLoci[index_nSize]>0)]) does not work
> > properly.
> > How can I get the unique values of an array based on their indexes?
> I don't know what that sentence means. Please show us some complete
> code that gives you a result that you do not expect and show us the
> result that you do expect.
> 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
> NumPy-Discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion