Search
Search Results
Search finished, found 18 page(s) matching the search query.
- numpy.memmap.reshape
...numpy.memmap.reshape...
- numpy.memmap.reshape (Python method, in numpy.memmap.reshape)
- NumPy 1.12.0 Release Notes
...ith multiple ellipsis raises IndexError, e.g., a[..., ...]. Non-integers used as index values raise TypeError, e.g., in reshape, take, and specifying reduce axis. FutureWarning to changed behavior np.full now returns an array of the fil...
- NumPy 1.13.0 Release Notes
...). Calling expand_dims when the axis keyword does not satisfy -a.ndim - 1 <= axis <= a.ndim, where a is the array being reshaped, is deprecated. Future Changes Assignment between structured arrays with different field names will change...
- NumPy 1.25.0 Release Notes
...now possible to perform inplace matrix multiplication via the @= operator. >>> import numpy as np >>> a = np.arange(6).reshape(3, 2) >>> print(a) [[0 1] [2 3] [4 5]] >>> b = np.ones((2, 2), dtype=int) >>> a @= b >>> print(a) [[1 1] [5...
- NumPy 2.0.0 Release Notes
...construction is always np.take(unique, unique_inverse, axis=axis). When 2.0.0 needs to be supported, add unique_inverse.reshape(-1) to code. (gh-25553, gh-25570) any and all return booleans for object arrays The any and all functions and...
- numpy.lib.Arrayterator
...the next dimension, until all elements have been read. Examples >>> import numpy as np >>> a = np.arange(3 * 4 * 5 * 6).reshape(3, 4, 5, 6) >>> a_itor = np.lib.Arrayterator(a, 2) >>> a_itor.shape (3, 4, 5, 6) Now we can iterate over a_ito...
- numpy.memmap.flat
...n a copy of the array collapsed into one dimension. flatiter Examples >>> import numpy as np >>> x = np.arange(1, 7).reshape(2, 3) >>> x array([[1, 2, 3], [4, 5, 6]]) >>> x.flat[3] 4 >>> x.T array([[1, 4], [2, 5], [3...
- numpy.memmap.mT
...y([[1, 2], [3, 4]]) >>> a array([[1, 2], [3, 4]]) >>> a.mT array([[1, 3], [2, 4]]) >>> a = np.arange(8).reshape((2, 2, 2)) >>> a array([[[0, 1], [2, 3]], [[4, 5], [6, 7]]]) >>> a.mT array([[[0, 2],...
- numpy.memmap.reshape
...numpy.memmap.reshape...
- numpy.memmap.resize
...False. Examples Shrinking an array: array is flattened (in the order that the data are stored in memory), resized, and reshaped: >>> import numpy as np >>> a = np.array([[0, 1], [2, 3]], order='C') >>> a.resize((2, 1)) >>> a array([[0],...
- numpy.memmap.shape
...e of array dimensions. The shape property is usually used to get the current shape of an array, but may also be used to reshape the array in-place by assigning a tuple of array dimensions to it. As with numpy.reshape, one of the new shape...
- numpy.memmap.strides
...tion in the next row. As such, the strides for the array x will be (20, 4). Examples >>> import numpy as np >>> y = np.reshape(np.arange(2*3*4), (2,3,4)) >>> y array([[[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]],...
- numpy.memmap.transpose
...ermuted. See also transposeEquivalent function. ndarray.TArray property returning the array transposed. ndarray.reshapeGive a new shape to an array without changing its data. Examples >>> import numpy as np >>> a = np.array([[1,...
- numpy.memmap.view
...in calculations >>> x = np.array([(1, 2),(3,4)], dtype=[('a', np.int8), ('b', np.int8)]) >>> xv = x.view(dtype=np.int8).reshape(-1,2) >>> xv array([[1, 2], [3, 4]], dtype=int8) >>> xv.mean(0) array([2., 3.]) Making changes to the...
- Standard array subclasses
...ursive algorithms. To loop over the entire array requires \(N\) for-loops. >>> import numpy as np >>> a = np.arange(24).reshape(3,2,4) + 10 >>> for val in a: ... print('item:', val) item: [[10 11 12 13] [14 15 16 17]] item: [[18 19 20 2...
- Structured arrays
...y.lib import recfunctions as rfn >>> dt = np.dtype([('a', 'i4'), ('b', 'f4,u2'), ('c', 'f4', 2)]) >>> a = np.arange(20).reshape((4,5)) >>> a array([[ 0, 1, 2, 3, 4], [ 5, 6, 7, 8, 9], [10, 11, 12, 13, 14], [15,...
- Subclassing ndarray
...those of numpy. For convenience, many numpy functions that have a corresponding ndarray method (e.g., sum, mean, take, reshape) work by checking if the first argument to a function has a method of the same name. If it exists, the method is...