Skip to content

 zarr.save

zarr.save

save(
    store: StoreLike,
    *args: NDArrayLike,
    zarr_format: ZarrFormat | None = None,
    path: str | None = None,
    **kwargs: Any,
) -> None

Save an array or group of arrays to the local file system.

Parameters:

  • store (StoreLike) –

    StoreLike object to open. See the storage documentation in the user guide for a description of all valid StoreLike values.

  • *args (ndarray, default: () ) –

    NumPy arrays with data to save.

  • zarr_format ((2, 3, None), default: 2 ) –

    The zarr format to use when saving.

  • path (str or None, default: None ) –

    The path within the group where the arrays will be saved.

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

    NumPy arrays with data to save.

Source code in zarr/api/synchronous.py
def save(
    store: StoreLike,
    *args: NDArrayLike,
    zarr_format: ZarrFormat | None = None,
    path: str | None = None,
    **kwargs: Any,  # TODO: type kwargs as valid args to async_api.save
) -> None:
    """Save an array or group of arrays to the local file system.

    Parameters
    ----------
    store : StoreLike
        StoreLike object to open. See the
        [storage documentation in the user guide][user-guide-store-like]
        for a description of all valid StoreLike values.
    *args : ndarray
        NumPy arrays with data to save.
    zarr_format : {2, 3, None}, optional
        The zarr format to use when saving.
    path : str or None, optional
        The path within the group where the arrays will be saved.
    **kwargs
        NumPy arrays with data to save.
    """
    return sync(async_api.save(store, *args, zarr_format=zarr_format, path=path, **kwargs))