Array API — NumPy v2.6.dev0 Manual
Sets the memory location item of dtype descr to value . The function is equivalent to setting a single array element with a Python assignment. Returns 0 on ...
Sets the memory location item of dtype descr to value . The function is equivalent to setting a single array element with a Python assignment. Returns 0 on ...
This function must be declared so that it is visible to code outside of the routine. Besides adding the methods and constants you desire, this subroutine must also contain calls like import_array() and/or import_ufunc() depending on which C-API is needed.
A pointer to a function that returns a standard Python object from a single element of the array object arr pointed to by data. This function must be able to deal with “misbehaved “ (misaligned and/or swapped) arrays correctly.
This function returns a (C-style) contiguous and behaved function array from any nested sequence or array interface exporting object, op, of (non-flexible) type given by the enumerated typenum, of minimum depth min_depth, and of maximum depth max_depth.
The array scalars offer a hierarchy of Python types that allow a one-to-one correspondence between the datatype stored in an array and the Python-type that is returned when an element is extracted from the array. An exception to this rule was made with object arrays. Object arrays are heterogeneous collections of arbitrary Python objects. When you select an item from an object array, you get ...
This function must be declared so that it is visible to code outside of the routine. Besides adding the methods and constants you desire, this subroutine must also contain calls like import_array() and/or import_ufunc() depending on which C-API is needed.
This function returns a (C-style) contiguous and behaved function array from any nested sequence or array interface exporting object, op, of (non-flexible) type given by the enumerated typenum, of minimum depth min_depth, and of maximum depth max_depth.
Creating a new universal function # Before reading this, it may help to familiarize yourself with the basics of C extensions for Python by reading/skimming the tutorials in Section 1 of Extending and Embedding the Python Interpreter and in How to extend NumPy The umath module is a computer-generated C-module that creates many ufuncs. It provides a great many examples of how to create a ...
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.