Search
Search Results
Search finished, found 44 page(s) matching the search query.
- numpy.record.dtype
...numpy.record.dtype...
- numpy.record.dtype (Python attribute, in numpy.record.dtype)
- Data type objects (
dtype
)...NumPy reference Array objects Data type objects (dtype)...
- Miscellaneous
...use equality to test NaNs. E.g.: >>> myarr = np.array([1., 0., np.nan, 3.]) >>> np.nonzero(myarr == np.nan) (array([], dtype=int64),) >>> np.nan == np.nan # is always False! Use special numpy functions instead. False >>> myarr[myarr == np...
- NumPy 1.10.0 Release Notes
...correlate. Future Changes In array comparisons like arr1 == arr2, many corner cases involving strings or structured dtypes that used to return scalars now issue FutureWarning or DeprecationWarning, and in the future will be change to ei...
- NumPy 1.10.2 Release Notes
...s Relaxed stride checking is no longer the default There were back compatibility problems involving views changing the dtype of multidimensional Fortran arrays that need to be dealt with over a longer timeframe. Fix swig bug in numpy.i R...
- NumPy 1.12.0 Release Notes
...rvening fields in the original array, unlike the copy in 1.12, which will affect code such as arr[['f1', 'f3']].view(newdtype). Second, for numpy versions 1.6 to 1.12 assignment between structured arrays occurs “by field name”: Fields in th...
- NumPy 1.13.0 Release Notes
...um.reduce(x), which is consistent with how this would be done with np.minimum. Calling ndarray.conjugate on non-numeric dtypes is deprecated (it should match the behavior of np.conjugate, which throws an error). Calling expand_dims when the...
- NumPy 1.14.1 Release Notes
...g ufuncs with a positional output argument. #10561: BUG: Fix various Big-Endian test failures (ppc64) #10562: BUG: Make dtype.descr error for out-of-order fields. #10563: BUG: arrays not being flattened in union1d #10607: MAINT: Update sphi...
- NumPy 1.16.0 Release Notes
...ans that complex64 is now 4-byte aligned instead of 8-byte aligned. An important consequence is that aligned structured dtypes may now have a different size. For instance, np.dtype('c8,u1', align=True) used to have an itemsize of 16 (on x64...
- NumPy 1.19.0 Release Notes
...mmonType has been changed to adhere to those used by np.result_type. This means that input such as (1000, np.array([1], dtype=np.uint8))) will now return uint16 dtypes. In most cases the behaviour is unchanged. Note that the use of this C-A...
- NumPy 1.20.0 Release Notes
...ease use of modern features across different hardware platforms. This work is ongoing. Preliminary work in changing the dtype and casting implementations in order to provide an easier path to extending dtypes. This work is ongoing but enoug...
- NumPy 1.7.0 Release Notes
...ets converted to the array type (of possibly larger size) as illustrated by the following examples: >>> (np.zeros((2,), dtype=np.uint8) + np.int16(257)).dtype dtype('uint16') >>> (np.zeros((2,), dtype=np.int8) + np.uint16(257)).dtype dtype(...
- numpy.char.chararray.view
...numpy.char.chararray.view method char.chararray.view([dtype][, type]) New view of array with the same data. Note Passing None for dtype is different from omitting the parame...
- numpy.lib.format
...nary file format in NumPy for persisting a single arbitrary NumPy array on disk. The format stores all of the shape and dtype information necessary to reconstruct the array correctly even on another machine with a different architecture. Th...
- numpy.lib.format.drop_metadata
...numpy.lib.format.drop_metadata lib.format.drop_metadata(dtype, /)[source] Returns the dtype unchanged if it contained no metadata or a copy of the dtype if it (or any of its st...
- numpy.lib.format.dtype_to_descr
...NumPy’s module structure Lib module (numpy.lib) numpy.lib.format numpy.lib.format.dtype_to_descr...
- numpy.ma.masked_array.toflex
..., True), (3, False)], [(4, True), (5, False), (6, True)], [(7, False), (8, True), (9, False)]], dtype=[('_data', '<i8'), ('_mask', '?')])...
- numpy.ma.masked_array.torecords
..., True), (3, False)], [(4, True), (5, False), (6, True)], [(7, False), (8, True), (9, False)]], dtype=[('_data', '<i8'), ('_mask', '?')])...
- numpy.ma.MaskedArray.toflex
..., True), (3, False)], [(4, True), (5, False), (6, True)], [(7, False), (8, True), (9, False)]], dtype=[('_data', '<i8'), ('_mask', '?')])...
- numpy.ma.MaskedArray.torecords
..., True), (3, False)], [(4, True), (5, False), (6, True)], [(7, False), (8, True), (9, False)]], dtype=[('_data', '<i8'), ('_mask', '?')])...
- numpy.matrix.view
...numpy.matrix.view method matrix.view([dtype][, type]) New view of array with the same data. Note Passing None for dtype is different from omitting the parame...
- numpy.memmap.view
...numpy.memmap.view method memmap.view([dtype][, type]) New view of array with the same data. Note Passing None for dtype is different from omitting the parame...
- numpy.ndarray.view
...numpy.ndarray.view method ndarray.view([dtype][, type]) New view of array with the same data. Note Passing None for dtype is different from omitting the parame...
- numpy.rec.array
...numpy.rec.array rec.array(obj, dtype=None, shape=None, offset=0, strides=None, formats=None, names=None, titles=None, aligned=False, byteorder=None, co...
- numpy.rec.fromarrays
...numpy.rec.fromarrays rec.fromarrays(arrayList, dtype=None, shape=None, formats=None, names=None, titles=None, aligned=False, byteorder=None)[source] Create a record ar...
- numpy.rec.fromfile
...numpy.rec.fromfile rec.fromfile(fd, dtype=None, shape=None, offset=0, formats=None, names=None, titles=None, aligned=False, byteorder=None)[source] Create a...
- numpy.rec.fromrecords
...numpy.rec.fromrecords rec.fromrecords(recList, dtype=None, shape=None, formats=None, names=None, titles=None, aligned=False, byteorder=None)[source] Create a recarray...
- numpy.rec.fromstring
...numpy.rec.fromstring rec.fromstring(datastring, dtype=None, shape=None, offset=0, formats=None, names=None, titles=None, aligned=False, byteorder=None)[source] Create a...
- numpy.recarray
...numpy.recarray class numpy.recarray(shape, dtype=None, buf=None, offset=0, strides=None, formats=None, names=None, titles=None, byteorder=None, aligned=False, orde...
- numpy.recarray.view
...numpy.recarray.view method recarray.view([dtype][, type]) New view of array with the same data. Note Passing None for dtype is different from omitting the parame...
- numpy.record
...calar attribute identical to the corresponding array attribute. basebase object dataPointer to start of data. device dtypedtype object flagsinteger value of flags flatA 1-D view of the scalar. imagThe imaginary part of the scalar. it...
- numpy.record.dtype
...numpy.record.dtype...
- NumPy: the absolute basics for beginners
...damental data structure of PyTorch is the “tensor”). Array attributes This section covers the ndim, shape, size, and dtype attributes of an array. The number of dimensions of an array is contained in the ndim attribute. >>> a.ndim 2 T...
- NumPy’s module structure
....testing numpy.typing Special-purpose namespaces numpy.ctypeslib - interacting with NumPy objects with ctypes numpy.dtypes - dtype classes (typically not used directly by end users) numpy.emath - mathematical functions with automatic do...
- Record Arrays (
numpy.rec
)...ations of these using structured types, such as: >>> import numpy as np >>> a = np.array([(1, 2.0), (1, 2.0)], ... dtype=[('x', np.int64), ('y', np.float64)]) >>> a array([(1, 2.), (1, 2.)], dtype=[('x', '<i8'), ('y', '<f8')]) Here,...
- Standard array subclasses
...e. Note For ufuncs, it is hoped to eventually deprecate this method in favour of __array_ufunc__. class.__array__(dtype=None, copy=None) If defined on an object, should return an ndarray. This method is called by array-coercion functi...
- Structured arrays
...ed as a sequence of named fields. For example, >>> x = np.array([('Rex', 9, 81.0), ('Fido', 3, 27.0)], ... dtype=[('name', 'U10'), ('age', 'i4'), ('weight', 'f4')]) >>> x array([('Rex', 9, 81.), ('Fido', 3, 27.)], dtype=[...
- The
numpy.ma
module...edArray class. A second possibility is to use the two masked array constructors, array and masked_array. array(data[, dtype, copy, order, mask, ...]) An array class with possibly masked values. masked_array alias of MaskedArray A th...
- Typing (
numpy.typing
)...ype aliases are available to users, most prominently the two below: ArrayLike: objects that can be converted to arrays DTypeLike: objects that can be converted to dtypes Mypy plugin New in version 1.21. A mypy plugin for managing a num...
- Array API
...k(const PyArray_Descr *descr, void *item, const PyObject *value) New in version 2.0. 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...
- Array objects
...ons Special methods Scalars Built-in scalar types Attributes Indexing Methods Defining new types Data type objects (dtype) Specifying and constructing data types Checking the data type dtype Data type promotion in NumPy Detailed behav...
- Glossary
...slicing creates a copy, in NumPy slicing creates a view. For details, see Combining advanced and basic indexing. <In a dtype declaration, indicates that the data is little-endian (the bracket is big on the right). >>> dt = np.dtype('<f')...
- Indexing on
ndarrays
...[ 6, 7, 8], ... [ 9, 10, 11]]) >>> rows = np.array([[0, 0], ... [3, 3]], dtype=np.intp) >>> columns = np.array([[0, 2], ... [0, 2]], dtype=np.intp) >>> x[rows, columns] arra...