我正在使用
xarray
来使用 xarray.open_mfdataset
组合多个 netcdf 文件。但是我在运行命令时收到错误,下面是命令和错误。
nc_all = xarray.open_mfdataset(files,combine = 'nested', concat_dim="time")
files = glob.glob("/filepath/*")
我收到以下错误-
Traceback (most recent call last):
File "/home/lsrathore/GLEAM/GLEAM_HPC.py", line 85, in <module>
nc_1980_90 = xarray.open_mfdataset(files[1:11],combine = 'nested', concat_dim="time")
File "/home/lsrathore/.local/lib/python3.9/site-packages/xarray/backends/api.py", line 1038, in open_mfdataset
datasets = [open_(p, **open_kwargs) for p in paths]
File "/home/lsrathore/.local/lib/python3.9/site-packages/xarray/backends/api.py", line 1038, in <listcomp>
datasets = [open_(p, **open_kwargs) for p in paths]
File "/home/lsrathore/.local/lib/python3.9/site-packages/xarray/backends/api.py", line 572, in open_dataset
ds = _dataset_from_backend_dataset(
File "/home/lsrathore/.local/lib/python3.9/site-packages/xarray/backends/api.py", line 367, in _dataset_from_backend_dataset
ds = _chunk_ds(
File "/home/lsrathore/.local/lib/python3.9/site-packages/xarray/backends/api.py", line 315, in _chunk_ds
chunkmanager = guess_chunkmanager(chunked_array_type)
File "/home/lsrathore/.local/lib/python3.9/site-packages/xarray/core/parallelcompat.py", line 87, in guess_chunkmanager
raise ValueError(
ValueError: unrecognized chunk manager dask - must be one of: []
是什么导致了这个问题?
当我将
xarray
版本从2023.5.0降级到0.21.1时,问题得到解决
它的工作原理是将 xarray 版本降级为 2022.11.0
如果我先安装 dask,它适用于最新的 xarray-2023.7.0:
pip install dask
。