numpoly.ones

numpoly.ones(shape: Union[int, Sequence[int]], dtype: Union[numpy.dtype[Any], None, Type[Any], numpy._typing._dtype_like._SupportsDType[numpy.dtype[Any]], str, Tuple[Any, int], Tuple[Any, Union[SupportsIndex, Sequence[SupportsIndex]]], List[Any], numpy._typing._dtype_like._DTypeDict, Tuple[Any, Any]] = <class 'float'>, order: Optional[Union[Literal[C], Literal[F]]] = 'C')numpoly.baseclass.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) or 2.

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])