Nadav Horesh schreef:
> I think you have a problem of overflow in r5: You may better use utin64
> instead of uint32.
>
> Nadav.
>
>
Nadav,
My problems were due to trying to do two things at once.
The code below does what I want and it is very fast. I see the power of
numpy now:
import numpy
I think you have a problem of overflow in r5: You may better use utin64 instead
of uint32.
Nadav.
-הודעה מקורית-
מאת: [EMAIL PROTECTED] בשם Folkert Boonstra
נשלח: ב 05-מאי-08 19:17
אל: Discussion of Numerical Python
נושא: Re: [Numpy-discussion] Learn about numpy
Folkert Boonstra
Folkert Boonstra schreef:
> Nadav Horesh schreef:
>
>> What you do here is a convolution with
>>
>> 0 1 0
>> 1 1 1
>> 0 1 0
>>
>> kernel, and thresholding, you can use numpy.numarray.nd_image package:
>>
>> import numpy.numarray.nd_image as NI
>> .
>> .
>> .
>>ker = array([[0,1,0], [1,1,1],
Nadav Horesh schreef:
> What you do here is a convolution with
>
> 0 1 0
> 1 1 1
> 0 1 0
>
> kernel, and thresholding, you can use numpy.numarray.nd_image package:
>
> import numpy.numarray.nd_image as NI
> .
> .
> .
>ker = array([[0,1,0], [1,1,1],[0,1,0]])
>result = (NI.convolve(self.bufb
cases you can use the function generic_filter in the same
package.
Nadav.
-הודעה מקורית-
מאת: [EMAIL PROTECTED] בשם Folkert Boonstra
נשלח: א 04-מאי-08 12:52
אל: numpy-discussion@scipy.org
נושא: [Numpy-discussion] Learn about numpy
With a python background but new to numpy, I have
With a python background but new to numpy, I have the following.
Suppose I have a 2-D array and I want to apply a function to each element.
The function needs to access the direct neighbouring elements in order
to set a new value for the element. How would I do that in the most
efficient way with