save_idata#
- pymc_marketing.data.idata.io.save_idata(idata, path, *, groups=None, **kwargs)[source]#
Write
idatain the format implied bypath.- Parameters:
idata (
DataTree) – Tree to write.path (
str|Path) –.zarror an existing directory for a Zarr store, anything else for netCDF.groups (
list[str] |None) – Groups to keep. All groups are written whenNone.**kwargs (
Any) – Passed toxarray.DataTree.to_netcdf()orxarray.DataTree.to_zarr().
- Return type:
Path- Returns:
pathas apathlib.Path.- Raises:
ImportError – If
pathis a Zarr store andzarris not installed.ValueError – If a Zarr store cannot hold names that differ only by letter case on this filesystem; see
idata_to_zarr().
Examples
from pymc_marketing.data.idata import save_idata save_idata(mmm.idata, "model.nc") save_idata(mmm.idata, "model.zarr", groups=["posterior"])