NumPy reference — NumPy v2.3 Manual
NumPy reference#. Release: 2.3. Date: June 09, 2025. This reference manual details functions, modules, and objects included in NumPy, describing what they ...
NumPy reference#. Release: 2.3. Date: June 09, 2025. This reference manual details functions, modules, and objects included in NumPy, describing what they ...
Returns an object that acts like pyfunc, but takes arrays as input.Takes an arbitrary Python function and returns a NumPy ufunc.
An array, any object exposing the array interface, an object whose __array__ method returns an array, or any (nested) sequence. If object is a scalar, a 0-dimensional array containing object is returned.
A pointer to a function that sets the Python object item into the array, arr, at the position pointed to by data . This function deals with “misbehaved” arrays. If successful, a zero is returned, otherwise, a negative one is returned (and a Python error set).
The ndarray can be inherited from (in Python or in C) if desired. Therefore, it can form a foundation for many useful classes. Often whether to sub-class the array object or to simply use the core array component as an internal part of a new class is a difficult decision, and can be simply a matter of choice. NumPy has several tools for simplifying how your new object interacts with other ...
If multiple objects should be returned then you need to return a tuple. The Py_BuildValue (format_string, c_variables…) function makes it easy to build tuples of Python objects from C variables.
An array, any object exposing the array interface, an object whose __array__ method returns an array, or any (nested) sequence. If object is a scalar, a 0-dimensional array containing object is returned.
The resulting wrapper function will return a Python float representation of 0.0 when the vector lengths do not match. Since this is not NULL, the Python interpreter will not know to check for an error.
Reference object to allow the creation of arrays which are not NumPy arrays. If an array-like passed in as like supports the __array_function__ protocol, the result will be defined by it.
A number of functions, supplied by numpy.i, are called to make and check the (possible) conversion from a generic Python object to a NumPy array.PyArrayObject* ary, a NumPy array. Test whether ary is contiguous. If so, return 1. Otherwise, set a Python error and return 0.
The __array_priority__ attribute is used to determine what type of object to return in situations where there is more than one possibility for the Python type of the returned object.
Jun 28, 2026 · NumPy reference # Release: 2.5 Date: June 28, 2026 This reference manual details functions, modules, and objects included in NumPy, describing what they are and what they do. For learning how to use NumPy, see the complete documentation. Python API #