None or int or tuple of ints, optional Axis or axes along which to operate. By default, flattened input is used. If this is a tuple of ints, the maximum is selected over multiple axes, instead of a single axis or all the axes as before.
out
ndarray, optional Alternative output array in which to place the result. Must be of the same shape and buffer length as the expected output. See doc.ufuncs (Section “Output arguments”) for more details.
keepdims
bool, optional If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the original arr.
return
amax : ndarray or scalar
Maximum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.
return
reshaped_array : ndarray , This will be a new view object if possible; otherwise, it will be a copy. Note there is no guarantee of the memory layout (C- or Fortran- contiguous) of the returned array.
Simple UseCase
nan
替换为0
data[np.isnan(data)] = 0
array
值分布numpy.load
Load arrays or pickled objects from .npy, .npz or pickled files.
numpy.save
numpy.array(object, dtype=None, copy=True, order='K', subok=False, ndmin=0)
return ndarray: An array object satisfying the specified requirements.\
reference https://www.yiibai.com/numpy/numpy_ndarray_object.html
ndarray.max(axis=None, out=None)
numpy.amax(a, axis=None, out=None, keepdims=False)
return amax : ndarray or scalar Maximum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.
numpy.zeros(shape, dtype=float, order='C')
return ndarray: Array of zeros with the given shape, dtype, and order.
numpy.arange([start, ]stop, [step, ]dtype=None)
numpy.reshape(a, newshape, order='C')
return reshaped_array : ndarray , This will be a new view object if possible; otherwise, it will be a copy. Note there is no guarantee of the memory layout (C- or Fortran- contiguous) of the returned array.
numpy.atleast_1d(*arys)
numpy.expand_dims(a, axis)