Skip to content

 zarr.open_like

zarr.open_like

open_like(
    a: ArrayLike, path: str, **kwargs: Any
) -> AnyArray

Open a persistent array like another array.

Parameters:

  • a (Array) –

    The shape and data-type of a define these same attributes of the returned array.

  • path (str) –

    The path to the new array.

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

    Any keyword arguments to pass to the array constructor.

Returns:

Source code in zarr/api/synchronous.py
def open_like(a: ArrayLike, path: str, **kwargs: Any) -> AnyArray:
    """Open a persistent array like another array.

    Parameters
    ----------
    a : Array
        The shape and data-type of a define these same attributes of the returned array.
    path : str
        The path to the new array.
    **kwargs
        Any keyword arguments to pass to the array constructor.

    Returns
    -------
    AsyncArray
        The opened array.
    """
    return Array(sync(async_api.open_like(a, path=path, **kwargs)))