Hi,
I am polishing some code to compute autocorrelation using fft, and
when testing the code against numpy.correlate, I realised that I am not
sure about the definition... There are various function related to
correlation as far as numpy/scipoy is concerned:
numpy.correlate
nump
Abel Daniel wrote:
> to what 'a+b' means with a and b being numpy arrays. But 'A=B' means something
> completely different than 'a==b'.
>
>
I disagree: A=B "on the blackboard" does mean that every element in A
equals its positionally-corresponding element in B, and a==b in numpy
will only be w
Steve Lianoglou wrote:
>> a[where(a < 0)] = 0
> Ah ... I see, w/o the where returns a boolean array. I reckon that's
> actually better to use than the where clause for cases like this
> since (for one) it'll take up less memory than arrays of ints.
not to mention that you're creating an entir
On 12/11/06, Tim Hirzel <[EMAIL PROTECTED]> wrote:
Hi,
Does anyone know how to get fromfile and tofile to work from a
tempfile.TemporaryFile? Or if its not possible?
I am getting this:
>>> import tempfile
>>> f = tempfile.TemporaryFile()
>>> f
', mode 'w+b' at 0x01EE1728>
>>> a = numpy.arange(
On 12/11/06, Steve Lianoglou <[EMAIL PROTECTED]> wrote:
> > It's not relevant to the point of this discussion all that much, but:
> >
> >> a[a < 0] = 0
> >> a[less(a, 0)] = 0
> >
> > Instead I've been doing something like:
> >
> > a[where(a < 0)] = 0
> >
> > I didn't realized you could do it the ot
> It's not relevant to the point of this discussion all that much, but:
>
>> a[a < 0] = 0
>> a[less(a, 0)] = 0
>
> Instead I've been doing something like:
>
> a[where(a < 0)] = 0
>
> I didn't realized you could do it the other way. Is there a
> difference somewhere between the two, or are they inte
Hi,
It's not relevant to the point of this discussion all that much, but:
> a[a < 0] = 0
> a[less(a, 0)] = 0
Instead I've been doing something like:
a[where(a < 0)] = 0
I didn't realized you could do it the other way. Is there a
difference somewhere between the two, or are they interchangeab
Hi,
Does anyone know how to get fromfile and tofile to work from a
tempfile.TemporaryFile? Or if its not possible?
I am getting this:
>>> import tempfile
>>> f = tempfile.TemporaryFile()
>>> f
', mode 'w+b' at 0x01EE1728>
>>> a = numpy.arange(10)
>>> a.tofile(f)
Traceback (most recent call
Hi,
> current behaviour. That is, what "A+B" on a blackboard in a math class
> means maps nicely to what 'a+b' means with a and b being numpy arrays. But
> 'A=B' means something completely different than 'a==b'.
This mapping is dangerous, I think A+B and A-B might be the only cases where
it actu
Abel Daniel wrote:
> Robert Kern gmail.com> writes:
>
>> Abel Daniel wrote:
>>> Now, I think that having a way of getting an element-wise comparison
>>> (i.e. getting an array of bools) is great. _But_ why make that the
>>> result of a '==' comparison? Is there any actual code that does, for
>>>
Abel Daniel wrote:
> Robert Kern gmail.com> writes:
>
>
>> Abel Daniel wrote:
>>
>>> Now, I think that having a way of getting an element-wise comparison
>>> (i.e. getting an array of bools) is great. _But_ why make that the
>>> result of a '==' comparison? Is there any actual code that do
Robert Kern gmail.com> writes:
>
> Abel Daniel wrote:
> > Now, I think that having a way of getting an element-wise comparison
> > (i.e. getting an array of bools) is great. _But_ why make that the
> > result of a '==' comparison? Is there any actual code that does, for
> > example
> result
Abel Daniel wrote:
> Hi!
>
> My unittests got broken because 'a==b' for numpy arrays returns an
> array instead of returning True or False:
>
import numpy
a = numpy.array([1, 2])
b = numpy.array([1, 4])
a==b
> array([True, False], dtype=bool)
>
> This means, for example:
Hi Daniel,
Just out of curiosity, what's wrong with
if all(a==b):
...
?
Cheers,
David
2006/12/11, Abel Daniel <[EMAIL PROTECTED]>:
>
Hi!
My unittests got broken because 'a==b' for numpy arrays returns an
array instead of returning True or False:
>>> import numpy
>>> a = numpy.array([1,
>
Hi!
My unittests got broken because 'a==b' for numpy arrays returns an
array instead of returning True or False:
>>> import numpy
>>> a = numpy.array([1, 2])
>>> b = numpy.array([1, 4])
>>> a==b
array([True, False], dtype=bool)
This means, for example:
>>> if a==b:
... print 'equal'
...
Trac
El dl 11 de 12 del 2006 a les 14:16 +0100, en/na Alexandre Fayolle va
escriure:
> > > I can work around this by using an intermediate string representation:
> > >
> > > temp = Numeric.fromstring(atest.tostring(), atest.typecode())
> > > temp.shape = atest.shape
> >
> > Another (faster) workaround
R. David wrote:
> Hello,
>
>
>
>> Try replacing 'int' with intc (or numpy.intc if you are not using
>> 'import *'). The following 'works' for me in the sense that it doesn't
>> throw any errors (although I imagine the results are nonsense):
>>
> Thanks, it works now !!
>
Great. Glad th
Hello,
> Try replacing 'int' with intc (or numpy.intc if you are not using
> 'import *'). The following 'works' for me in the sense that it doesn't
> throw any errors (although I imagine the results are nonsense):
Thanks, it works now !!
Sorry for non including the whole code, I just not wante
R. David wrote:
> Hello Tim,
>
>> The problem is probably your definition of ipiv. "(DIM)" is just a
>> parenthesized scalar, what you probably want is "(DIM,)", which is a
>> one-tuple. Personally, I'd recommend using list notation ("[nbrows,
>> nbcols]", "[DIM]") rather than tuple notation
Hello Tim,
>
> The problem is probably your definition of ipiv. "(DIM)" is just a
> parenthesized scalar, what you probably want is "(DIM,)", which is a
> one-tuple. Personally, I'd recommend using list notation ("[nbrows,
> nbcols]", "[DIM]") rather than tuple notation since it's both easier t
R. David wrote:
> Hello,
>
> I am trying to use the lapack_lite dgesv routine.
>
> The following sample code :
>
> from numpy import *
> []
> a=zeros((nbrows,nbcols),float,order='C')
> []
> ipiv=zeros((DIM),int,order='C')
> []
> linalg.lapack_lite.dgesv(DIM,1,a,DIM,asarray(ipiv),b,DIM,i
On Thu, Dec 07, 2006 at 05:36:22PM +0100, Francesc Altet wrote:
> El dj 07 de 12 del 2006 a les 16:50 +0100, en/na Alexandre Fayolle va
> escriure:
> > Hi,
> >
> > I'm facing a memory leak on an application that has to use numarray and
> > Numeric (because of external dependencies).
> >
> > The
Hello,
I am trying to use the lapack_lite dgesv routine.
The following sample code :
from numpy import *
[]
a=zeros((nbrows,nbcols),float,order='C')
[]
ipiv=zeros((DIM),int,order='C')
[]
linalg.lapack_lite.dgesv(DIM,1,a,DIM,asarray(ipiv),b,DIM,info)
leads do the followin error messa
23 matches
Mail list logo