1

I'm not sure if it's a version compatibility issue either. I've spent a lot of time trying but still can't get it to work. Please help me!The codes and mistakes are as follows:

[in]:
print(xr.__version__, '     ', zarr.__version__)
xr.open_dataarray(r'D:\AVISO_SLA_copernicusmarine\SLA_2001.nc'
                  ).to_zarr(r'D:\AVISO_SLA_copernicusmarine\SLA_2001111.zarr', mode='w')
[out]:
2024.11.0       3.0.7

TypeError                                 Traceback (most recent call last)
Cell In[22], line 3
      1 print(xr.__version__, '     ', zarr.__version__)
      2 xr.open_dataarray(r'D:\AVISO_SLA_copernicusmarine\SLA_2001.nc'
----> 3                   ).to_zarr(r'D:\AVISO_SLA_copernicusmarine\SLA_2001111.zarr', mode='w')

File c:\Users\Admin\anaconda3\envs\xeofs\Lib\site-packages\xarray\core\dataarray.py:4435, in DataArray.to_zarr(self, store, chunk_store, mode, synchronizer, group, encoding, compute, consolidated, append_dim, region, safe_chunks, storage_options, zarr_version)
   4431 else:
   4432     # No problems with the name - so we're fine!
   4433     dataset = self.to_dataset()
-> 4435 return to_zarr(  # type: ignore[call-overload,misc]
   4436     dataset,
   4437     store=store,
   4438     chunk_store=chunk_store,
   4439     mode=mode,
   4440     synchronizer=synchronizer,
   4441     group=group,
   4442     encoding=encoding,
   4443     compute=compute,
   4444     consolidated=consolidated,
   4445     append_dim=append_dim,
   4446     region=region,
   4447     safe_chunks=safe_chunks,
   4448     storage_options=storage_options,
...
     47     f"{name}={arg}"
     48     for name, arg in zip(kwonly_args[:extra_args], args[-extra_args:], strict=False)
     49 ]

TypeError: Group.create_array() got an unexpected keyword argument 'exists_ok'
Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...
2
  • 1
    I think you need to update your xarray version to one that is compatible with zarr version 3, alternatively downgrade zarr to 2.18 Commented May 12 at 19:06
  • @Ianhi, you are right. Thank you. If you had the time, you could create an answer yourself. Commented Aug 27 at 12:33

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.