nlcpy.full
- nlcpy.full(shape, fill_value, dtype=None, order='C')[source]
Returns a new array of given shape and type, filled with fill_value.
- Parameters
- shapeint or sequence of ints
Shape of the new array, e.g.,
(2, 3)
or2
.- fill_valuescalar
Fill value.
- dtypedtype, optional
The desired dtype for the array, e.g,
nlcpy.int64
. Default isnlcpy.float64
.- order{‘C’, ‘F’}, optional
Whether to store multidimensional data in C- or Fortran-contiguous (row- or column-wise) order in memory.
- Returns
- outndarray
Array of fill_value with the given shape, dtype, and order.
See also
Examples
>>> import nlcpy as vp >>> vp.full((2, 2), vp.inf) array([[inf, inf], [inf, inf]]) >>> vp.full((2, 2), 10) array([[10, 10], [10, 10]])