Skip to content

 zarr.full

zarr.full

full(
    shape: tuple[int, ...], fill_value: Any, **kwargs: Any
) -> AnyArray

Create an array with a default fill value.

Parameters:

  • shape (int or tuple of int) –

    Shape of the empty array.

  • fill_value (scalar) –

    Fill value.

  • **kwargs (Any, default: {} ) –

    Keyword arguments passed to create.

Returns:

  • Array

    The new array.

Source code in zarr/api/synchronous.py
def full(shape: tuple[int, ...], fill_value: Any, **kwargs: Any) -> AnyArray:
    """Create an array with a default fill value.

    Parameters
    ----------
    shape : int or tuple of int
        Shape of the empty array.
    fill_value : scalar
        Fill value.
    **kwargs
        Keyword arguments passed to [`create`][zarr.api.asynchronous.create].

    Returns
    -------
    Array
        The new array.
    """
    return Array(sync(async_api.full(shape=shape, fill_value=fill_value, **kwargs)))