xarray - how to rename dimensions on a DataArray object - Stack Overflow

PHOTO EMBED

Wed Mar 17 2021 04:12:14 GMT+0000 (Coordinated Universal Time)

Saved by @diptish #python

# rios is dataarray (var) name
rio.rename({'x': 'longitude','y': 'latitude'})
content_copyCOPY

rename coordinates from x and y to longitude and latitude resp.

https://stackoverflow.com/questions/56162366/xarray-how-to-rename-dimensions-on-a-dataarray-object