Cython is a superset of Python, so any valid Python code is valid Cython code. In this case, if you have a NumPy array, just passing it to the constructor of the tuple
class should work just fine (as in normal Python).
a = np.array([1, 2, 3]) t = tuple(a)
Cython will take care of converting these constructs into corresponding C function calls.
source share