79364540

Date: 2025-01-17 11:06:41
Score: 0.5
Natty:
Report link

The use of ds.dims in the accepted answer is now deprecated. Instead, you should use ds.sizes, like so:

tuple(ds.sizes[d] for d in ['X', 'Y'])

This works consistently for both xarray.DataArray and xarray.Dataset.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: TheBamf