You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
temp = air.air
temp_wm = temp.weighted(air.gw).mean('lat', keep_attrs=True)
print('before weighted mean\n',[(c,temp[c].attrs) for c in temp.coords])
print('\nafter\n',[(c,temp_wm[c].attrs) for c in temp_wm.coords])
Thanks for opening your first issue here at xarray! Be sure to follow the issue template!
If you have an idea for a solution, we would really welcome a Pull Request with proposed changes.
See the Contributing Guide for more.
It may take us a while to respond here, but we really value your contribution. Contributors like you help make xarray better.
Thank you!
JdeJong96
changed the title
Missing coordinate dimensions after weighted mean
Missing coordinate attributes after weighted mean
Aug 6, 2024
What is your issue?
After performing a weighted mean with
keep_attrs=True
along a specific dimension in aDataset
, no remaining coordinates have attributes left:returns
Likewise for a
DataArray
:returns
I think this is the first issue regarding this problem. Have not tested any other weighted operations yet.
Output of xr.show_versions():
The text was updated successfully, but these errors were encountered: