blosc2.full#

blosc2.full(shape, fill_value, dtype=None, **kwargs)#

Create an array, with fill_value being used as the default value for uninitialized portions of the array.

Parameters:
  • shape (int, tuple or list) – The shape for the final array.

  • fill_value (bytes, int, float or bool) – Default value to use for uninitialized portions of the array. Its size will override the typesize in the cparams in case they are passed.

  • dtype (np.dtype) – The ndarray dtype in NumPy format. By default, this will be taken from the fill_value. This will override the typesize in the cparams in case they are passed.

  • kwargs (dict, optional) – Keyword arguments that are supported by the empty() constructor.

Returns:

out – A NDArray is returned.

Return type:

NDArray

Examples

>>> import blosc2
>>> import numpy as np
>>> shape = [25, 10]
>>> # Create array filled with True
>>> array = blosc2.full(shape, True)
>>> array.shape
(25, 10)
>>> array.dtype
dtype('bool')