numpoly.ones#
- numpoly.ones(shape: int | ~typing.Sequence[int], dtype: DTypeLike = <class 'float'>, order: ~typing.Literal['C'] | ~typing.Literal['F'] | None = 'C') ndpoly[source]#
Return a new array of given shape and type, filled with ones.
- Args:
- shape:
Shape of the new array, e.g.,
(2, 3)or2.- dtype:
The desired data-type for the array, e.g., numpy.int8. Default is numpy.float64.
- order:
Whether to store multi-dimensional data in row-major (C-style) or column-major (Fortran-style) order in memory.
- Return:
Array of ones with the given shape, dtype, and order.
- Example:
>>> numpoly.ones(5) polynomial([1.0, 1.0, 1.0, 1.0, 1.0])