bundles / numpy 2.4.3 / numpy / matlib / zeros
function
numpy.matlib:zeros
source: /numpy/matlib.py:111
Signature
def zeros(shape, dtype = None, order = C)Summary
Return a matrix of given shape and type, filled with zeros.
Parameters
shape: int or sequence of intsShape of the matrix
dtype: data-type, optionalThe desired data-type for the matrix, default is float.
order: {'C', 'F'}, optionalWhether to store the result in C- or Fortran-contiguous order, default is 'C'.
Returns
out: matrixZero matrix of given shape, dtype, and order.
Notes
If shape has length one i.e. (N,), or is a scalar N, out becomes a single row matrix of shape (1,N).
Examples
import numpy.matlib
✓np.matlib.zeros((2, 3))
✗matrix([[0., 0., 0.],
[0., 0., 0.]])
np.matlib.zeros(2)
✗matrix([[0., 0.]])
See also
- matlib.ones
Return a matrix of ones.
- numpy.zeros
Equivalent array function.
Aliases
numpy.matlib.zeros