Cython Program With Numpy Arrays Does Not Allow Vectorized Inputs (only Accepts Length 1 Arrays), How To Fix?
FIXED: see updated code below. This is my first Cython attempt and have a working build but it doesn't allow numpy array (vectors) as inputs, which is my real purpose here. It is
Solution 1:
There were two issues here:
TypeError: CyBlack() takes exactly 7 positional arguments (14 given)
This was caused by the fact that you were unpacking your input arrays using the
*
("splat") operator. You needed to pass them in as 7 separate arguments instead.ValueError: Buffer dtype mismatch, expected 'float64_t' but got 'long long'
:This error was telling you that one of the input arrays had a C type of
long long
(which is a 64 bit integer), rather thanfloat64_t
as specified in your input type declarations. You needed to cast all of your input arrays tonp.float64
.
Post a Comment for "Cython Program With Numpy Arrays Does Not Allow Vectorized Inputs (only Accepts Length 1 Arrays), How To Fix?"