How to pass a numpy array of string types to a function in Cython

后端 未结 2 797
天命终不由人
天命终不由人 2021-02-05 08:46

Passing a numpy array of dtype np.float64_t works fine ( below), but I can\'t pass string arrays.

This is what works :

# c         


        
2条回答
  •  清酒与你
    2021-02-05 09:29

    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.

提交回复
热议问题