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,
On Mon, Sep 21, 2009 at 8:12 PM, David Warde-Farley d...@cs.toronto.edu 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
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
pass
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
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 algorithms
On Tue, Sep 22, 2009 at 3:45 PM, Sturla Molden stu...@molden.no 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
René Dudfield wrote:
On Mon, Sep 21, 2009 at 8:12 PM, David Warde-Farley d...@cs.toronto.edu
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
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 use to
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 way...really).
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 you
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
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?
12 matches
Mail list logo