Search
Searching.
- Interoperability with NumPy > The array interface protocol
...oreign object, they will try (in order): The buffer protocol, described in the Python C-API documentation. The __array_interface__ protocol, described in this page. A precursor to Python’s buffer protocol, it defines a way to access the co...
- The array interface protocol
...NumPy reference Array objects The array interface protocol...
- Array API
...*context) This is the main function used to obtain an array from any nested sequence, or object that exposes the array interface, op. The parameters allow specification of the required dtype, the minimum (min_depth) and maximum (max_depth)...
- Array creation
...h a variety of techniques though that certainly is much more work and requires significantly more advanced knowledge to interface with C or C++. 6) Use of special library functions (e.g., SciPy, pandas, and OpenCV) NumPy is the fundamenta...
- Array objects
...Examples Constants of the numpy.ma module The MaskedArray class MaskedArray methods Masked array operations The array interface protocol Python side C-struct access Type description examples Differences with array interface (version 2)...
- Boilerplate reduction and templating
...Boilerplate reduction and templating Using FYPP for binding generic interfaces f2py doesn’t currently support binding interface blocks. However, there are workarounds in use. Perhaps the b...
- ctypes foreign function interface (
numpy.ctypeslib
)...NumPy reference NumPy’s module structure ctypes foreign function interface (numpy.ctypeslib)...
- Data types
...itsizes, dependent on the platforms (e.g. 32-bit vs. 64-bit CPU architectures). This should be taken into account when interfacing with low-level code (such as C or Fortran) where the raw memory is addressed. Data Types for Strings and B...
- F2PY examples
...and places the result in a third. The memory for all three arrays must be provided by the calling routine. A very basic interface to this routine can be automatically generated by f2py: python -m numpy.f2py -m add add.f This command will...
- How to extend NumPy
...ce is returned. Otherwise, a new array is constructed. The contents of obj are copied to the new array unless the array interface is used so that data does not have to be copied. Objects that can be converted to an array include: 1) any nes...
- Interoperability with NumPy
...oreign object, they will try (in order): The buffer protocol, described in the Python C-API documentation. The __array_interface__ protocol, described in this page. A precursor to Python’s buffer protocol, it defines a way to access the co...
- Iterating over arrays
...he nditer is to visit every element of an array. Each element is provided one by one using the standard Python iterator interface. Example >>> import numpy as np >>> a = np.arange(6).reshape(2,3) >>> for x in np.nditer(a): ... print(...
- Miscellaneous
...an]) >>> j = np.seterr(**oldsettings) # restore previous ... # error-handling settings Interfacing to C Only a survey of the choices. Little detail on how each works. Bare metal, wrap your own C-code manual...
- NumPy 1.10.0 Release Notes
...function call, while automatically selecting the fastest evaluation order. The new function np.stack provides a general interface for joining a sequence of arrays along a new axis, complementing np.concatenate for joining along an existing...
- NumPy 1.12.0 Release Notes
- NumPy 1.13.0 Release Notes
...sneginf with f(x, y=out) is deprecated - the argument should be passed as f(x, out=out), which matches other ufunc-like interfaces. Use of the C-API NPY_CHAR type number deprecated since version 1.7 will now raise deprecation warnings at ru...
- NumPy 1.15.0 Release Notes
...or testing, we have switched to pytest as a replacement for the no longer maintained nose framework. The old nose based interface remains for downstream projects who may still be using it. The Python versions supported by this release are 2...
- NumPy 1.17.0 Release Notes
...should not be relied upon. Scalar min and max take part in promotion rules like they do in all other ufuncs. __array_interface__ offset now works as documented The interface may use an offset value that was mistakenly ignored. Pickle p...
- NumPy 1.18.0 Release Notes
...g64, _sfc64, ``_common, _generator, and _bounded_integers respectively to indicate that they are not part of the public interface. (gh-14608) C API changes PyDataType_ISUNSIZED(descr) now returns False for structured datatypes Previousl...
- NumPy 1.19.0 Release Notes
- NumPy 1.20.0 Release Notes
...ayLike objects which do not define __len__ and __getitem__ Objects which define one of the protocols __array__, __array_interface__, or __array_struct__ but are not sequences (usually defined by having a __len__ and __getitem__) will behave...
- NumPy 1.21.0 Release Notes
...ing array-like creation When an object raised an exception during access of the special attributes __array__ or __array_interface__, this exception was usually ignored. A warning is now given when the exception is anything but AttributeErro...
- NumPy 1.24 Release Notes
...aised where previously TypeError or RuntimeError was raised. This allows falling back to the buffer protocol or __array_interface__ when DLPack was tried first. (gh-22542) NumPy builds are no longer tested on GCC-6 Ubuntu 18.04 is depreca...
- NumPy 1.26.0 Release Notes
- NumPy 1.6.0 Release Notes
...s as zero length arrays which caused unpredicted results. Thanks to Lorenz Hüdepohl for pointing out the correct way to interface routines with assumed shape arrays. In addition, f2py supports now automatic wrapping of Fortran routines that...
- NumPy 1.7.0 Release Notes
...perimental support for the AArch64 architecture. C API New function PyArray_FailUnlessWriteable provides a consistent interface for checking array writeability – any C code which works with arrays whose WRITEABLE flag is not known to be T...
- NumPy 1.9.0 Release Notes
...nomial classes have been refactored to use an abstract base class rather than a template in order to implement a common interface. This makes importing the polynomial package faster as the classes do not need to be compiled on import. Mor...
- NumPy 2.0.0 Release Notes
- NumPy C code explanations
- numpy.array
- numpy.i: a SWIG interface file for NumPy
- Standard array subclasses
.... However, most subclasses of the array object will not redefine certain aspects of the array object such as the buffer interface, or the attributes of the array. One important example, however, of why your subroutine may not be able to han...
- Structured arrays
- Subclassing ndarray
...ore. Subclassing and downstream compatibility When sub-classing ndarray or creating duck-types that mimic the ndarray interface, it is your responsibility to decide how aligned your APIs will be with those of numpy. For convenience, many...
- Testing the numpy.i typemaps
- The array interface protocol
...NumPy reference Array objects The array interface protocol...
- The N-dimensional array (
ndarray
) - Using F2PY bindings in Python
- Writing custom array containers
- object.__array_interface__ (Python data, in The array interface protocol)
- object.__array_struct__ (Python data, in The array interface protocol)
numpy.polynomial
- Byte-swapping
- Data type API
- Data type objects (
dtype
) - Extending
- F2PY reference manual
- F2PY user guide and reference manual
- Generalized universal function API
- Memory management in NumPy
- NumPy 1.11.1 Release Notes
- NumPy 1.16.3 Release Notes
- NumPy 1.26.1 Release Notes
- NumPy 1.5.0 Release Notes
- NumPy 2.0 migration guide
- NumPy 2.1.1 Release Notes
- NumPy and SWIG
- NumPy reference
- numpy.char.chararray
- numpy.char.chararray.flags
- numpy.char.chararray.setflags
- numpy.einsum
- numpy.frombuffer
- numpy.lib.array_utils.byte_bounds
- numpy.linalg.qr
- numpy.ma.frombuffer
- numpy.ma.masked_array.flags
- numpy.ma.masked_array.setflags
- numpy.ma.MaskedArray.__array__
- numpy.ma.MaskedArray.flags
- numpy.matrix.flags
- numpy.matrix.setflags
- numpy.memmap.flags
- numpy.memmap.setflags
- numpy.ndarray