blosc2.full#

blosc2.full(shape: int | tuple | list, fill_value: bytes | int | float | bool, dtype: dtype | str = None, **kwargs: Any) NDArray#

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 of 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 if they are passed.

  • dtype (np.dtype or list str) – The ndarray dtype in NumPy format. By default, this will be taken from the fill_value. This will override the typesize in the cparams if 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')