spatialdata.deepcopy

Contents

spatialdata.deepcopy#

spatialdata.deepcopy(element)#

Deepcopy a SpatialData or SpatialElement object.

Deepcopy will load the data in memory. Using this function for large Dask-backed objects is discouraged. In that case, please save the SpatialData object to a different disk location and read it back again.

Parameters:

element (Union[SpatialData, SpatialImage, MultiscaleSpatialImage, GeoDataFrame, DataFrame, AnnData]) – The SpatialData or SpatialElement object to deepcopy

Return type:

Union[SpatialData, SpatialImage, MultiscaleSpatialImage, GeoDataFrame, DataFrame, AnnData]

Returns:

: A deepcopy of the SpatialData or SpatialElement object

Notes

The order of the columns for a deepcopied points element may be differ from the original one, please see more here: scverse/spatialdata#486