Search
Search Results
Search finished, found 39 page(s) matching the search query.
- Set routines
...NumPy reference Routines and objects by topic Set routines...
- Discrete Fourier Transform
...Transform The SciPy module scipy.fft is a more comprehensive superset of numpy.fft, which includes only a basic set of routines. Standard FFTs fft(a[, n, axis, norm, out]) Compute the one-dimensional discrete Fourier Transform. ifft(a[...
- Memory management in NumPy
...ved its memory management capabilities, and began providing various management policies beginning in version 3.4. These routines are divided into a set of domains, each domain has a PyMemAllocatorEx structure of routines for memory manageme...
- NumPy 1.16.0 Release Notes
..._matmul__ operator can now be overridden by __array_ufunc__. Its implementation has also changed. It uses the same BLAS routines as numpy.dot, ensuring its performance is similar for large matrices. Start and stop arrays for linspace, log...
- NumPy 1.4.0 Release Notes
...appropriate class, without altering the warning state. Reusing npymath In 1.3.0, we started putting portable C math routines in npymath library, so that people can use those to write portable extensions. Unfortunately, it was not possib...
- numpy.i: a SWIG interface file for NumPy
...-output? SWIG cannot determine these details, and does not attempt to do so. If we designed rms, we probably made it a routine that takes an input-only array of length n of double values called seq and returns the root mean square. The de...
- Routines and objects by topic
...NumPy reference Routines and objects by topic...
- Set routines
...NumPy reference Routines and objects by topic Set routines...
- Signature file
...[<usercode statement>]... [ interface <usercode statement> <Fortran block data signatures> <Fortran/C routine signatures> end [interface] ]... [ interface module <F90 modulename> [<F90 module data type de...
- Array API
...if the array was created using slicing or some other operation where a clearly-distinguishable parent is present). This routine can do anything it wants to. It should return a -1 on error and 0 otherwise. Data access These functions and...
- Array creation
...Array creation See also Array creation routines Introduction There are 6 general mechanisms for creating arrays: Conversion from other Python structures (i....
- Array iterator API
...is used, and this operand is buffered, this changes how data is copied from the buffer into the array. A masked copying routine is used, which only copies the elements in the buffer for which writemasked returns true from the corresponding...
- Beyond the basics
...work either if you pass this object back to Python — so you shouldn’t do this). Note that the returned object from this routine is still usually cast to PyArrayIterObject *. All that’s been done is to modify the strides and dimensions of th...
- BLAS and LAPACK
...In case no suitable library is found, the NumPy build will print a warning and then use (slow!) NumPy-internal fallback routines. In order to disallow use of those slow routines, the allow-noblas build option can be used: $ python -m pip in...
- F2PY test suite
...ise depend on a compiler need to call compiler_check_f2pycli() instead of f2pycli(). Example Consider the following subroutines, contained in a file named add-test.f subroutine addb(k) real(8), intent(inout) :: k(:)...
- How to extend NumPy
...ample, if you need to just extract a pointer to memory along with some shape information to pass to another calculation routine, then you will use very different calls than if you are trying to create a new array-like type or add a new data...
- Indexing on
ndarrays
...Indexing on ndarrays See also Indexing routines ndarrays can be indexed using the standard Python x[obj] syntax, where x is the array and obj the selection. T...
- Internal organization of NumPy arrays
...aches to consider: 1) accept that the first index is just not the most rapidly changing in memory and have all your I/O routines reorder your data when going from memory to disk or visa versa, or use NumPy’s mechanism for mapping the first...
- NumPy 1.13.0 Release Notes
...r to override the behavior of NumPy’s ufuncs. This works quite similarly to Python’s __mul__ and other binary operation routines. See the documentation for a more detailed description of the implementation and behavior of this new option. T...
- NumPy 1.18.0 Release Notes
...nfiguring NumPy, the files _numpyconfig.h and config.h are created by probing support for various runtime functions and routines. Previously, the very verbose compiler output during this stage clouded more important information. By default...
- NumPy 1.26.1 Release Notes
...orted in previous releases. -Dallow-noblas: if set to true, allow NumPy to build with its internal (very slow) fallback routines instead of linking against an external BLAS/LAPACK library. The default for this flag may be changed to ``true`...
- NumPy 2.0.0 Release Notes
...or users of f2py only as a code generator, i.e. without -c. (gh-24532) bind(c) support for f2py Both functions and subroutines can be annotated with bind(c). f2py will handle both the correct type mapping, and preserve the unique label fo...
- NumPy C code explanations
...ured array field setting works more naturally (a[0]['f1'] = value). Indexing See also Indexing on ndarrays, Indexing routines All Python indexing operations arr[index] are organized by first preparing the index and finding the index typ...
- NumPy C-API
...Files NumPy provides a C-API to enable users to extend the system and get access to the array object for use in other routines. The best way to truly understand the C-API is to read the source code. If you are unfamiliar with (C) source c...
- NumPy quickstart
...print(element) ... 0 1 2 3 10 11 12 13 20 21 22 23 30 31 32 33 40 41 42 43 See also Indexing on ndarrays, Indexing routines (reference), newaxis, ndenumerate, indices Shape manipulation Changing the shape of an array An array has...
- NumPy reference
...ay subclasses Masked arrays The array interface protocol Datetimes and timedeltas Universal functions (ufunc) Routines and objects by topic Constants Array creation routines Array manipulation routines Bit-wise operations String f...
- NumPy: the absolute basics for beginners
...# may vary Read more about creating arrays, filled with 0’s, 1’s, other values or uninitialized, at array creation routines. Generating random numbers The use of random number generation is an important part of the configuration and...
- Reading and writing files
...Reading and writing files This page tackles common applications; for the full collection of I/O routines, see Input and output. Reading text and CSV files With no missing values Use numpy.loadtxt. With missing va...
- Scalars
...rray priority. generic.__array_wrap__ __array_wrap__ implementation for scalar types Indexing See also Indexing routines, Data type objects (dtype) Array scalars can be indexed like 0-dimensional arrays: if x is an array scalar, x...
- Standard array subclasses
...e any subclass of an ndarray, then asanyarray can be used to allow subclasses to propagate more cleanly through your subroutine. In principal a subclass could redefine any aspect of the array and therefore, under strict guidelines, asanyarr...
- String functionality
...ersal functions are also used in numpy.char, which provides the numpy.char.chararray array subclass, in order for those routines to get the performance benefits as well. Note Prior to NumPy 2.0, all string functionality was in numpy.char,...
- Structured arrays
...numpy.rec module provides a number of other convenience functions for creating record arrays, see record array creation routines. A record array representation of a structured array can be obtained using the appropriate view: >>> arr = np.a...
- Testing guidelines
...ackage 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 tests with good coverage mak...
- The N-dimensional array (
ndarray
)...{window.loadTryExamplesConfig("../try_examples.json");}); Constructing arrays New arrays can be constructed using the routines detailed in Array creation routines, and also by using the low-level ndarray constructor: ndarray(shape[, dty...
- Using F2PY
...[ skip: <fortran functions> : ]]... \ [<fortran files> ...] Note A Fortran source file can contain many routines, and it is often not necessary to allow all routines to be usable from Python. In such cases, either specify wh...
- Using F2PY bindings in Python
...nt argument types. For more examples and use cases, see F2PY examples. Fortran type objects All wrappers for Fortran/C routines, common blocks, or Fortran 90 module data generated by F2PY are exposed to Python as fortran type objects. Rout...
- Using Python as glue
...portions of your code). Therefore one of the most common needs is to call out from Python code to a fast, machine-code routine (e.g. compiled using C/C++ or Fortran). The fact that this is relatively easy to do is a big reason why Python i...
- Using the convenience classes
...NumPy reference Routines and objects by topic Polynomials Using the convenience classes...
- Writing your own ufunc
...It should be placed in a (module) dictionary under the same name as was used in the name argument to the ufunc-creation routine. The following example is adapted from the umath module static PyUFuncGenericFunction atan2_functions[] = {...