at() method was added to the NumPy universal function class in NumPy 1.8. This method allows fancy indexing in-place. Fancy indexing is indexing that does not involve integers or slices, which is normal indexing. "In-place" means that the data of the input array will be altered.
The signature for the
at() method is
ufunc.at(a, indices[, b]). The indices array corresponds to the elements to operate on. We must specify the
b array only for universal functions with two operands.
The following steps demonstrate how the
at() method works:
7random integers from
4with a seed of
np.random.seed(44) a = np.random.random_integers(-4, 4, 7) print(a)