René Dudfield wrote:
> On Mon, Sep 21, 2009 at 8:12 PM, David Warde-Farley
> wrote:
>
>> On 21-Sep-09, at 2:55 PM, Xavier Gnata wrote:
>>
>>
>>> Should I read that to learn you cython and numpy interact?
>>> Or is there another best documentation (with examples...)?
>>>
>> You shou
On Tue, Sep 22, 2009 at 3:45 PM, Sturla Molden wrote:
> Xavier Gnata skrev:
>> I have a large 2D numpy array as input and a 1D array as output.
>> In between, I would like to use C code.
>> C is requirement because it has to be fast and because the algorithm
>> cannot be written in a numpy oriente
Xavier Gnata skrev:
> I have a large 2D numpy array as input and a 1D array as output.
> In between, I would like to use C code.
> C is requirement because it has to be fast and because the algorithm
> cannot be written in a numpy oriented way :( (no way...really).
>
There are certain algorithm
René Dudfield skrev:
> Another way is to make your C function then load it with ctypes
Also one should beware that ctypes is a stable part of the Python
standard library.
Cython is still unstable and in rapid development.
Pyrex is more stabile than Cython, but interfacing with ndarrays is harder
René Dudfield skrev:
> Another way is to make your C function then load it with ctypes(or
> wrap it with something else) and pass it pointers with
> array.ctype.data.
numpy.ctypeslib.ndpointer is preferred when using ndarrays with ctypes.
> You can find the shape of the array in python, and
> p
On Mon, Sep 21, 2009 at 8:12 PM, David Warde-Farley wrote:
> On 21-Sep-09, at 2:55 PM, Xavier Gnata wrote:
>
>> Should I read that to learn you cython and numpy interact?
>> Or is there another best documentation (with examples...)?
>
> You should have a look at the Bresenham algorithm thread you
I give my vote to cython as well. I have a program which uses cython
for a portion simply because it was easier using a simple C for-loop
to do what i wanted rather than beating numpy into submission. It was
an order of magnitude faster as well.
Cheers,
Chris
On Mon, Sep 21, 2009 at 9:12 PM, Dav
On 21-Sep-09, at 2:55 PM, Xavier Gnata wrote:
> Should I read that to learn you cython and numpy interact?
> Or is there another best documentation (with examples...)?
You should have a look at the Bresenham algorithm thread you posted. I
went to the trouble of converting some Python code for B
Xavier Gnata wrote:
> David Cournapeau wrote:
>> That's only a data point, but I almost always use cython in those cases,
I'm a second data point, but I think there are many more. Judging from
the SciPy conference, Cython is the preferred method for new projects.
> Should I read that to learn y
David Cournapeau wrote:
> Xavier Gnata wrote:
>
>> Hi,
>>
>> I have a large 2D numpy array as input and a 1D array as output.
>> In between, I would like to use C code.
>> C is requirement because it has to be fast and because the algorithm
>> cannot be written in a numpy oriented way :( (no wa
Xavier Gnata wrote:
> Hi,
>
> I have a large 2D numpy array as input and a 1D array as output.
> In between, I would like to use C code.
> C is requirement because it has to be fast and because the algorithm
> cannot be written in a numpy oriented way :( (no way...really).
>
> Which tool should I
Hi,
I have a large 2D numpy array as input and a 1D array as output.
In between, I would like to use C code.
C is requirement because it has to be fast and because the algorithm
cannot be written in a numpy oriented way :( (no way...really).
Which tool should I use to achieve that? waeve.inline
12 matches
Mail list logo