Passing a numpy array of dtype np.float64_t
works fine ( below), but I can\'t pass string arrays.
This is what works :
# c
Looks like you're out of luck.
http://cython.readthedocs.org/en/latest/src/tutorial/numpy.html
Some data types are not yet supported, like boolean arrays and string arrays.
This answer is no longer valid as shown by Saullo Castro's answer, but I'll leave it for historical purposes.
With Cython 0.20.1 it works using cdef np.ndarray
, without specifying the data type and the number of dimensions:
import numpy as np
cimport numpy as np
cdef func1(np.ndarray A):
print A
def testing():
chunk = np.array([['huh','yea'], ['swell','ray']])
func1(chunk)