-
Book Overview & Buying
-
Table Of Contents
Learning Cython Programming (Second Edition) - Second Edition
By :
NumPy is a scientific library designed to provide functionality similar to or on par with MATLAB, which is a paid proprietary mathematics package. NumPy has a lot of popularity with Cython users since you can seek out more performance from your highly computational code using C types. In Cython, you can import this library as follows:
import numpy as np
cimport numpy as np
np.import_array()You can access full Python APIs as follows:
np.PyArray_ITER_NOTDONE
So, you can integrate with iterators at a very native area of the API. This allows NumPy users to get a lot of speed when working with native types via something as follows:
cdef double * val = (<double*>np.PyArray_MultiIter_DATA(it, 0))[0]We can cast the data from the array to double, and it's a cdef type in Cython to work with now. For more information and NumPy tutorials, visit https://github.com/cython/cython/wiki/tutorials-numpy.
Change the font size
Change margin width
Change background colour