Skip to content

 zarr.zeros

zarr.zeros

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

Create an array with a fill value of zero.

Parameters:

Returns:

  • Array

    The new array.

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

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

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