Search
Search Results
Search finished, found 64 page(s) matching the search query.
- numpy.block
...NumPy reference Routines and objects by topic Array manipulation routines numpy.block...
- numpy.block (Python function, in numpy.block)
numpy.distutils
user guide...orts automatic conversion of source files named <somefile>.src. This facility can be used to maintain very similar code blocks requiring only simple changes between blocks. During the build phase of setup, if a template file named <somefile...
- Array creation
...at Copies and Views. There are a number of routines to join existing arrays e.g. numpy.vstack, numpy.hstack, and numpy.block. Here is an example of joining four 2-by-2 arrays into a 4-by-4 array using block: >>> import numpy as np >>> A =...
- How to contribute to the NumPy documentation
...ndard as shown in their example. Documenting C/C++ code NumPy uses Doxygen to parse specially-formatted C/C++ comment blocks. This generates XML files, which are converted by Breathe into RST, which is used by Sphinx. It takes three step...
- Internal organization of NumPy arrays
...e raw array data. The data buffer is typically what people think of as arrays in C or Fortran, a contiguous (and fixed) block of memory containing fixed-sized data items. NumPy also contains a significant set of data that describes how to i...
- Interoperability with NumPy
...flexible library for parallel computing in Python. Dask Array implements a subset of the NumPy ndarray interface using blocked algorithms, cutting up the large array into many small arrays. This allows computations on larger-than-memory ar...
- Memory management in NumPy
...nd-memset(0) and free respectively, but when npy_free_cache is called, it adds the pointer to a short list of available blocks marked by size. These blocks can be re-used by subsequent calls to npy_alloc*, avoiding memory thrashing. Confi...
- NumPy 1.10.2 Release Notes
...2.7+ and Win32. gh-6487 BUG: Allow nested use of parameters in definition of arrays in f2py. gh-6488 BUG: Extend common blocks rather than overwriting in f2py. gh-6499 DOC: Mention that default casting for inplace operations has changed. gh...
- NumPy 1.13.0 Release Notes
...roblems. 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 e...
- NumPy 1.13.1 Release Notes
...#9261 BUG: don’t elide into readonly and updateifcopy temporaries for… #9262 BUG: fix missing keyword rename for common block in numpy.f2py #9263 BUG: handle resize of 0d array #9267 DOC: update f2py front page and some doc build metadata....
- NumPy 1.15.0 Release Notes
...hout factors of 100 numpy.printoptions, a context manager that sets print options temporarily for the scope of the with block: >>> with np.printoptions(precision=2): ... print(np.array([2.0]) / 3) [0.67] numpy.histogram_bin_edges, a...
- NumPy 1.16.0 Release Notes
...oint operations. Now we can support non-glibc distributions like Alpine Linux as long as they ship fenv.h. Speedup np.block for large arrays Large arrays (greater than 512 * 512) now use a blocking algorithm based on copying the data dire...
- NumPy 1.21.0 Release Notes
...fect and the precision argument fixes the number of digits. (gh-18629) f2py now recognizes Fortran abstract interface blocks f2py can now parse abstract interface blocks. (gh-18695) BLAS and LAPACK configuration via environment variable...
- NumPy 1.22.0 Release Notes
...e present in standard conforming implementations. (gh-18585) Generate C/C++ API reference documentation from comments blocks is now possible This feature depends on Doxygen in the generation process and on Breathe to integrate it with Sph...
- NumPy 1.26.0 Release Notes
...y issue tracker. We aim to phase out setup.py builds as soon as possible, and therefore would like to see all potential blockers surfaced early on in the 1.26.0 release cycle. Contributors A total of 20 people contributed to this release...
- NumPy 1.26.3 Release Notes
...and a .pyf is passed, a warning is emitted and the -m provided name is ignored. Improvements f2py now handles common blocks which have kind specifications from modules. This further expands the usability of intrinsics like iso_fortran_en...
- NumPy 2.0.0 Release Notes
...complex.h, which means that complex is now a reserved keyword. (gh-24085) iso_c_binding support and improved common blocks for f2py Previously, users would have to define their own custom f2cmap file to use type mappings defined by the...
- NumPy for MATLAB users
...ing, See note INDEXING) [ 1 2 3; 4 5 6 ] np.array([[1., 2., 3.], [4., 5., 6.]]) define a 2x3 2D array [ a b; c d ] np.block([[a, b], [c, d]]) construct a matrix from blocks a, b, c, and d a(end) a[-1] access last element in MATLAB vector...
- numpy.block
...NumPy reference Routines and objects by topic Array manipulation routines numpy.block...
- numpy.bmat
...if obj is not a string. Returns: outmatrixReturns a matrix object, which is a specialized 2-D array. See also blockA generalization of this function for N-d arrays, that returns normal ndarrays. Examples >>> import numpy as np...
- numpy.char.chararray.strides
...6, 7, 8, 9]], dtype=np.int32) This array is stored in memory as 40 bytes, one after the other (known as a contiguous block of memory). The strides of an array tell us how many bytes we have to skip in memory to move to the next position...
- numpy.concat
...litSplit array into multiple sub-arrays along the 3rd axis (depth). stackStack a sequence of arrays along a new axis. blockAssemble arrays from blocks. hstackStack arrays in sequence horizontally (column wise). vstackStack arrays in seq...
- numpy.concatenate
...litSplit array into multiple sub-arrays along the 3rd axis (depth). stackStack a sequence of arrays along a new axis. blockAssemble arrays from blocks. hstackStack arrays in sequence horizontally (column wise). vstackStack arrays in seq...
- numpy.dstack
...with a height (first axis), width (second axis), and r/g/b channels (third axis). The functions concatenate, stack and block provide more general stacking and concatenation operations. Parameters: tupsequence of arraysThe arrays must hav...
- numpy.fill_diagonal
...unction can operate on a 4-D array: >>> a = np.zeros((3, 3, 3, 3), int) >>> np.fill_diagonal(a, 4) We only show a few blocks for clarity: >>> a[0, 0] array([[4, 0, 0], [0, 0, 0], [0, 0, 0]]) >>> a[1, 1] array([[0, 0, 0],...
- numpy.hstack
...with a height (first axis), width (second axis), and r/g/b channels (third axis). The functions concatenate, stack and block provide more general stacking and concatenation operations. Parameters: tupsequence of ndarraysThe arrays must h...
- numpy.i: a SWIG interface file for NumPy
...e in the way the C routine was intended. For Python, the preferred way of handling contiguous (or technically, strided) blocks of homogeneous data is with NumPy, which provides full object-oriented access to multidimensial arrays of data....
- numpy.kron
...n numpy.kron(a, b)[source] Kronecker product of two arrays. Computes the Kronecker product, a composite array made of blocks of the second array scaled by the first. Parameters: a, barray_like Returns: outndarray See also outerT...
- numpy.lib.Arrayterator
...] Buffered iterator for big arrays. Arrayterator creates a buffered iterator for reading big arrays in small contiguous blocks. The class is useful for objects stored in the file system. It allows iteration over the object without reading e...
- numpy.load
...ion: with load('foo.npz') as data: a = data['a'] The underlying file descriptor is closed when exiting the ‘with’ block. Examples >>> import numpy as np Store data to disk, and load it again: >>> np.save('/tmp/123', np.array([[1,...
- numpy.ma.dstack
...with a height (first axis), width (second axis), and r/g/b channels (third axis). The functions concatenate, stack and block provide more general stacking and concatenation operations. Parameters: tupsequence of arraysThe arrays must hav...
- numpy.ma.hstack
...with a height (first axis), width (second axis), and r/g/b channels (third axis). The functions concatenate, stack and block provide more general stacking and concatenation operations. Parameters: tupsequence of ndarraysThe arrays must h...
- numpy.ma.masked_array.strides
...6, 7, 8, 9]], dtype=np.int32) This array is stored in memory as 40 bytes, one after the other (known as a contiguous block of memory). The strides of an array tell us how many bytes we have to skip in memory to move to the next position...
- numpy.ma.MaskedArray.strides
...6, 7, 8, 9]], dtype=np.int32) This array is stored in memory as 40 bytes, one after the other (known as a contiguous block of memory). The strides of an array tell us how many bytes we have to skip in memory to move to the next position...
- numpy.ma.stack
...one more dimension than the input arrays. See also concatenateJoin a sequence of arrays along an existing axis. blockAssemble an nd-array from nested lists of blocks. splitSplit array into a list of multiple sub-arrays of equal siz...
- numpy.ma.vstack
...with a height (first axis), width (second axis), and r/g/b channels (third axis). The functions concatenate, stack and block provide more general stacking and concatenation operations. Parameters: tupsequence of ndarraysThe arrays must h...
- numpy.matrix.strides
...6, 7, 8, 9]], dtype=np.int32) This array is stored in memory as 40 bytes, one after the other (known as a contiguous block of memory). The strides of an array tell us how many bytes we have to skip in memory to move to the next position...
- numpy.memmap.strides
...6, 7, 8, 9]], dtype=np.int32) This array is stored in memory as 40 bytes, one after the other (known as a contiguous block of memory). The strides of an array tell us how many bytes we have to skip in memory to move to the next position...
- numpy.ndarray.strides
...6, 7, 8, 9]], dtype=np.int32) This array is stored in memory as 40 bytes, one after the other (known as a contiguous block of memory). The strides of an array tell us how many bytes we have to skip in memory to move to the next position...
- numpy.printoptions
...options(*args, **kwargs)[source] Context manager for setting print options. Set print options for the scope of the with block, and restore the old options at the end. See set_printoptions for the full description of available options. See...
- numpy.recarray.strides
...6, 7, 8, 9]], dtype=np.int32) This array is stored in memory as 40 bytes, one after the other (known as a contiguous block of memory). The strides of an array tell us how many bytes we have to skip in memory to move to the next position...
- numpy.stack
...one more dimension than the input arrays. See also concatenateJoin a sequence of arrays along an existing axis. blockAssemble an nd-array from nested lists of blocks. splitSplit array into a list of multiple sub-arrays of equal siz...
- numpy.unstack
...e also stackJoin a sequence of arrays along a new axis. concatenateJoin a sequence of arrays along an existing axis. blockAssemble an nd-array from nested lists of blocks. splitSplit array into a list of multiple sub-arrays of equal siz...
- numpy.vstack
...with a height (first axis), width (second axis), and r/g/b channels (third axis). The functions concatenate, stack and block provide more general stacking and concatenation operations. Parameters: tupsequence of ndarraysThe arrays must h...
- NumPy: the absolute basics for beginners
...tures from others that have the same name. Reading the example code Throughout the NumPy documentation, you will find blocks that look like: >>> a = np.array([[1, 2, 3], ... [4, 5, 6]]) >>> a.shape (2, 3) Text preceded by...
- Packaging (
numpy.distutils
)...orts automatic conversion of source files named <somefile>.src. This facility can be used to maintain very similar code blocks requiring only simple changes between blocks. During the build phase of setup, if a template file named <somefile...
- Reading and writing files
...an arbitrarily formatted binary file (“binary blob”) Use a structured array. Example: The .wav file header is a 44-byte block preceding data_size bytes of the actual sound data: chunk_id "RIFF" chunk_size 4-byte unsigned littl...
- Signature file
...ive. When scanning Fortran codes to generate a signature file, F2PY lowers all cases automatically except in multi-line blocks or when the --no-lower option is used. The syntax of signature files is presented below. Signature files syntax...
- Using F2PY
...Reading fortran codes... Reading file 'doc/source/f2py/scalar.f' (format:fix,strict) Post-processing... Block: scalar Block: FOO Building modules... Building module "scalar"... Wrote C...
- Using F2PY bindings in Python
.... 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. Routine wrappers are...
- Using via
numpy.distutils
...h the <modulename> used in signature file. It is assumed that an F2PY signature file contains exactly one python module block. If sources do not contain a signature file, then F2PY is used to scan Fortran source files to construct wrappers...
- Advanced F2PY use cases
...be defined inside signature files using usercode and pymethoddef statements (they must be used inside the python module block). For example, the following signature file spam.pyf ! -*- f90 -*- python module spam usercode ''' static...
- Array API
...re performed. This can be accomplished using two groups of macros. Typically, if one macro in a group is used in a code block, all of them must be used in the same code block. NPY_ALLOW_THREADS is true (defined as 1) unless the build option...
- Array objects
...The items can be indexed using for example N integers. All ndarrays are homogeneous: every item takes up the same size block of memory, and all blocks are interpreted in exactly the same way. How each item in the array is to be interpreted...
- Boilerplate reduction and templating
...te 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 best known is the usage of tempita for using .pyf.src files a...
- Compatibility policy
...ive the same numbers as rng.random(5). We reserve the ability to decide to use different algorithms for different-sized blocks. In practice, this happens rarely. Like the rest of NumPy, we generally maintain API source compatibility from v...
- Data type objects (
dtype
)...ta type objects (dtype) A data type object (an instance of numpy.dtype class) describes how the bytes in the fixed-size block of memory corresponding to an array item should be interpreted. It describes the following aspects of the data: T...
- F2PY and build systems
...e outputs of f2py: Fortran 77 programs Input file blah.f Generates blahmodule.c blah-f2pywrappers.f When no COMMON blocks are present only a C wrapper file is generated. Wrappers are also generated to rewrite assumed shape arrays as au...
- F2PY user guide and reference manual
...77/90/95 external subroutines and Fortran 90/95 module subroutines as well as C functions; to access Fortran 77 COMMON blocks and Fortran 90/95 module data, including allocatable arrays from Python. Note Fortran 77 is essentially feature...
- Glossary
...gher dimensions, the picture changes. NumPy prints higher-dimensional vectors as replications of row-by-column building blocks, as in this three-dimensional vector: >>> a = np.arange(12).reshape(2,2,3) >>> a array([[[ 0, 1, 2], [...
- Parallel random number generation
...e to jump enough to make those distances small enough to overlap in your lifetime. jumped can be used to produce long blocks which should be long enough to not overlap. import secrets from numpy.random import PCG64 seed = secrets.getrand...
- Reviewer guidelines
...your issue, please paste the output of: ``` python -c 'import numpy; print(numpy.version.version)' ``` Thanks. Code blocksReadability can be greatly improved if you [format](https://help.github.com/articles/creating-and-highlighting-cod...
- The N-dimensional array (
ndarray
)...ay, or by some other object), combined with an indexing scheme that maps N integers into the location of an item in the block. The ranges in which the indices can vary is specified by the shape of the array. How many bytes each item takes...