Static numpy::npyffi::array::PY_ARRAY_API [−][src]
pub static PY_ARRAY_API: PyArrayAPI
A global variable which stores a ‘capsule’ pointer to Numpy Array API.
You can acceess raw c APIs via this variable and its Deref implementation.
See PyArrayAPI for what methods you can use via this variable.
Example
use numpy::{PyArray, npyffi::types::NPY_SORTKIND, PY_ARRAY_API}; pyo3::Python::with_gil(|py| { let array = PyArray::from_slice(py, &[3, 2, 4]); unsafe { PY_ARRAY_API.PyArray_Sort(array.as_array_ptr(), 0, NPY_SORTKIND::NPY_QUICKSORT); } assert_eq!(array.readonly().as_slice().unwrap(), &[2, 3, 4]); })