| [ Web Proxy ] |
| Viewing: https://numpy.org/doc/stable/reference/generated/../generated/numpy.matlib.ones.html | [Back] [Original] |
Matrix of ones.
Return a matrix of given shape and type, filled with ones.
Shape of the matrix
The desired data-type for the matrix, default is np.float64.
Whether to store matrix in C- or Fortran-contiguous order, default is C.
Matrix of ones of given shape, dtype, and order.
See also
onesArray of ones.
matlib.zerosZero matrix.
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
>>> np.matlib.ones((2,3))
matrix([[1., 1., 1.],
[1., 1., 1.]])
>>> np.matlib.ones(2)
matrix([[1., 1.]])
| Web Proxy Viewer | New URL | Original Page |