Search
Search Results
Search finished, found 33 page(s) matching the search query.
- Array API
...ate intelligence is the ability to hold two opposed ideas in the mind at the same time, and still retain the ability to function. — F. Scott Fitzgerald For a successful technology, reality must take precedence over public relations, for N...
- Array creation
...ms for creating arrays: Conversion from other Python structures (i.e. lists and tuples) Intrinsic NumPy array creation functions (e.g. arange, ones, zeros, etc.) Replicating, joining, or mutating existing arrays Reading arrays from disk, e...
- Contributing to NumPy
...concise, and self- explanatory. Then click the button to submit it. If your commit introduces a new feature or changes functionality, post on the mailing list to explain your changes. For bug fixes, documentation updates, etc., this is gen...
- For downstream package authors
...g., NumPy 2.0 migration guide and NEP 52 — Python API cleanup for NumPy 2.0), so unless you only use modern/recommended functions and objects, your code is likely to require at least some adjustments. Plan to do a release of your own packag...
- How to contribute to the NumPy documentation
...cstrings in the code when the documentation is built. Although we have mostly complete reference documentation for each function and class exposed to users, there is a lack of usage examples for some of them. What we lack are docs with broa...
- How to extend NumPy
...This chapter documents the API calls and macros that are most commonly used. Required subroutine There is exactly one function that must be defined in your C-code in order for Python to use it as an extension module. The function must be...
- Iterating over arrays
...the iterator, buffering is recommended over temporary copying. Within NumPy, buffering is used by the ufuncs and other functions to support flexible inputs with minimal memory overhead. In our examples, we will treat the input array with a...
- Miscellaneous routines
...APACK library in use broadcast_shapes(*args) Broadcast the input shapes into a single shape. NumPy-specific help function info([object, maxwidth, output, toplevel]) Get help information for an array, function, class, or module....
- NumPy 1.12.0 Release Notes
...s. New signature argument to np.vectorize for vectorizing with core dimensions. The keepdims argument was added to many functions. New context manager for testing warnings Support for BLIS in numpy.distutils Much improved support for PyPy (...
- NumPy 1.13.0 Release Notes
...s. New __array_ufunc__ attribute provides improved ability for classes to override default ufunc behavior. New np.block function for creating blocked arrays. New functions New np.positive ufunc. New np.divmod ufunc provides more efficie...
- NumPy 1.14.0 Release Notes
...leases. More details can be found in NEP 12. This release supports Python 2.7 and 3.4 - 3.6. Highlights The np.einsum function uses BLAS when possible genfromtxt, loadtxt, fromregex and savetxt can now handle files with arbitrary Python s...
- NumPy 1.15.0 Release Notes
...NumPy 1.15.0 Release Notes NumPy 1.15.0 is a release with an unusual number of cleanups, many deprecations of old functions, and improvements to many existing functions. Please read the detailed descriptions below to see if you are af...
- NumPy 1.16.0 Release Notes
...should help make maintenance easier going forward. Highlights Experimental (opt-in only) support for overriding numpy functions, see __array_function__ below. The matmul function is now a ufunc. This provides better performance and allows...
- NumPy 1.17.0 Release Notes
...tatype and used when either stable or mergesort is passed as the method. See below under Improvements. Overriding numpy functions is now possible by default, see __array_function__ below. New functions numpy.errstate is now also a funct...
- NumPy 1.22.0 Release Notes
...lease. A preliminary version of the proposed Array-API is provided. This is a step in creating a standard collection of functions that can be used across applications such as CuPy and JAX. NumPy now has a DLPack backend. DLPack provides a c...
- NumPy 2.0 migration guide
...o an array (e.g. arr->descr->elsize) this is best replaced with PyArray_ITEMSIZE(arr). Where not possible, new accessor functions are required: PyDataType_ELSIZE and PyDataType_SET_ELSIZE (note that the result is now npy_intp and not int)....
- NumPy 2.0.0 Release Notes
...mpy.strings namespace with performant ufuncs for string operations, Support for float32 and longdouble in all numpy.fft functions, Support for the array API standard in the main numpy namespace. Performance improvements: Sorting function...
- NumPy for MATLAB users
...al purpose equivalents MATLAB NumPy Notes help func info(func) or help(func) or func? (in IPython) get help on the function func which func see note HELP find out where func is defined type func np.source(func) or func?? (in IPython)...
- NumPy security
...ork for all involved parties. Advice for using NumPy on untrusted data A user who can freely execute NumPy (or Python) functions must be considered to have the same privilege as the process/Python interpreter. That said, NumPy should be ge...
- numpy.i: a SWIG interface file for NumPy
...values called seq and returns the root mean square. The default behavior of SWIG, however, will be to create a wrapper function that compiles, but is nearly impossible to use from the scripting language in the way the C routine was intende...
- numpy.ufunc
...NumPy reference Universal functions (ufunc) numpy.ufunc...
- NumPy: the absolute basics for beginners
...contains multidimensional array data structures, such as the homogeneous, N-dimensional ndarray, and a large library of functions that operate efficiently on these data structures. Learn more about NumPy at What is NumPy, and if you have co...
- Structured arrays
...ically by numpy, but can also be specified. Structured datatype creation Structured datatypes may be created using the function numpy.dtype. There are 4 alternative forms of specification which vary in flexibility and conciseness. These ar...
- Subclassing ndarray
...des the additional complexities of subclassing a NumPy array, subclasses can run into unexpected behaviour because some functions may convert the subclass to a baseclass and “forget” any additional information associated with the subclass....
- Testing guidelines
...s that every module and package in NumPy should have a thorough set of unit tests. These tests should exercise the full functionality of a given routine as well as its robustness to erroneous or unexpected input arguments. Well-designed tes...
- Typing (
numpy.typing
)...o dtypes Mypy plugin New in version 1.21. A mypy plugin for managing a number of platform-specific annotations. Its functionality can be split into three distinct parts: Assigning the (platform-dependent) precisions of certain number s...
- Universal functions (
ufunc
)...NumPy reference Universal functions (ufunc)...
- Using F2PY
...2PY This page contains a reference to all command-line options for the f2py command, as well as a reference to internal functions of the numpy.f2py module. Using f2py as a command-line tool When used as a command-line tool, f2py has three...
- Writing your own ufunc
...Writing your own ufunc I have the Power! — He-Man Creating a new universal function Before reading this, it may help to familiarize yourself with the basics of C extensions for Python by reading/...
- Data type API
...NumPy types written using the legacy DType system. New NumPy dtypes will be written using the new DType API and may not function in the same manner as legacy DTypes. Use this macro if you want to handle legacy DTypes using different code pa...
- Indexing on
ndarrays
...[0, 1, 0]] array([1, 4, 5]) To achieve a behaviour similar to the basic slicing above, broadcasting can be used. The function ix_ can help with this broadcasting. This is best understood with an example. Example From a 4x3 array the corn...
- Setting up and using your development environment
...nterpart: (lldb) breakpoint set --name array_empty_like (lldb) run The execution will now stop at the corresponding C function and you can step through it as usual. A number of useful Python-specific commands are available. For example to...
- Signature file
...lename> contains a substring __user__, then the corresponding python module block describes the signatures of call-back functions (see Call-back arguments). A python module block has the following structure: python module <modulename> [<...