.. _docs-meteoinfolab-numeric-funcitons-ones: ******************* ones ******************* .. currentmodule:: mipylib.numeric.minum .. function:: ones(shape, dtype='float') Create a new aray of given shape and type, filled with ones. :param shape: (*int or sequence of ints*) Shape of the new array, e.g., ``(2, 3)`` or ``2``. :param dtype: (*data-type, optional*) The desired data-type for the array, including 'int', 'float' and 'double'. :returns: (*MIArray*) Array of ones with the given shape and dtype. Examples :: >>> ones(5) array([1.0, 1.0, 1.0, 1.0, 1.0]) >>> ones(5, dtype='int') array([1, 1, 1, 1, 1]) >>> ones((2, 1)) array([[1.0] [1.0]])