arviz.InferenceData.from_netcdf#
- static InferenceData.from_netcdf(filename, *, engine='h5netcdf', group_kwargs=None, regex=False, base_group='/')[source]#
Initialize object from a netcdf file.
Expects that the file will have groups, each of which can be loaded by xarray. By default, the datasets of the InferenceData object will be lazily loaded instead of being loaded into memory. This behaviour is regulated by the value of
az.rcParams["data.load"]
.- Parameters:
- filename
str
location of netcdf file
- engine{“h5netcdf”, “netcdf4”}, default “h5netcdf”
Library used to read the netcdf file.
- group_kwargs
dict
of {str:dict
}, optional Keyword arguments to be passed into each call of
xarray.open_dataset()
. The keys of the higher level should be group names or regex matching group names, the inner dicts re passed toopen_dataset
This feature is currently experimental.- regexbool, default
False
Specifies where regex search should be used to extend the keyword arguments. This feature is currently experimental.
- base_group
str
, default “/” The group in the netCDF file where the InferenceData is stored. By default, assumes that the file only contains an InferenceData object.
- filename
- Returns: