broadcast.shape

broadcast.shape Shape of broadcasted result. Examples >>> x = np.array([1, 2, 3]) >>> y = np.array([[4], [5], [6]]) >>> b = np.broadcast(x, y) >>> b.shape (3, 3)

broadcast.reset()

broadcast.reset() Reset the broadcasted result?s iterator(s). Parameters: None Returns: None Examples >>> x = np.array([1, 2, 3]) >>> y = np.array([[4], [5], [6]] >>> b = np.broadcast(x, y) >>> b.index 0 >>> b.next(), b.next(), b.next() ((1, 4), (2, 4), (3, 4)) >>> b.index 3 >>> b.reset() >>> b.index 0

broadcast.next

broadcast.next x.next() -> the next value, or raise StopIteration

broadcast.iters

broadcast.iters tuple of iterators along self?s ?components.? Returns a tuple of numpy.flatiter objects, one for each ?component? of self. See also numpy.flatiter Examples >>> x = np.array([1, 2, 3]) >>> y = np.array([[4], [5], [6]]) >>> b = np.broadcast(x, y) >>> row, col = b.iters >>> row.next(), col.next() (1, 4)

broadcast.index

broadcast.index current index in broadcasted result Examples >>> x = np.array([[1], [2], [3]]) >>> y = np.array([4, 5, 6]) >>> b = np.broadcast(x, y) >>> b.index 0 >>> b.next(), b.next(), b.next() ((1, 4), (1, 5), (1, 6)) >>> b.index 3

Binary operations

Elementwise bit operations bitwise_and(x1, x2[, out]) Compute the bit-wise AND of two arrays element-wise. bitwise_or(x1, x2[, out]) Compute the bit-wise OR of two arrays element-wise. bitwise_xor(x1, x2[, out]) Compute the bit-wise XOR of two arrays element-wise. invert(x[, out]) Compute bit-wise inversion, or bit-wise NOT, element-wise. left_shift(x1, x2[, out]) Shift the bits of an integer to the left. right_shift(x1, x2[, out]) Shift the bits of an integer to the right. Bit packin

Arrayterator.shape

Arrayterator.shape The shape of the array to be iterated over. For an example, see Arrayterator.

Arrayterator.flat

Arrayterator.flat A 1-D flat iterator for Arrayterator objects. This iterator returns elements of the array to be iterated over in Arrayterator one by one. It is similar to flatiter. See also Arrayterator, flatiter Examples >>> a = np.arange(3 * 4 * 5 * 6).reshape(3, 4, 5, 6) >>> a_itor = np.lib.Arrayterator(a, 2) >>> for subarr in a_itor.flat: ... if not subarr: ... print(subarr, type(subarr)) ... 0 <type 'numpy.int32'>

Array manipulation routines

Basic operations copyto(dst, src[, casting, where]) Copies values from one array to another, broadcasting as necessary. Changing array shape reshape(a, newshape[, order]) Gives a new shape to an array without changing its data. ravel(a[, order]) Return a contiguous flattened array. ndarray.flat A 1-D iterator over the array. ndarray.flatten([order]) Return a copy of the array collapsed into one dimension. Transpose-like operations moveaxis(a, source, destination) Move axes of an arra

Array creation routines

See also Array creation Ones and zeros empty(shape[, dtype, order]) Return a new array of given shape and type, without initializing entries. empty_like(a[, dtype, order, subok]) Return a new array with the same shape and type as a given array. eye(N[, M, k, dtype]) Return a 2-D array with ones on the diagonal and zeros elsewhere. identity(n[, dtype]) Return the identity array. ones(shape[, dtype, order]) Return a new array of given shape and type, filled with ones. ones_like(a[, dtyp