-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
NetCDF attributes like long_name
and units
lost on .mean()
#442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hmm. This is definitely a bug -- load should preserve all metadata. |
Could you post an example dataset/code for which this occurs? I'm struggling to reproduce this. |
long_name
and units
lost on load()
long_name
and units
lost on ~~.lost()
~~ .mean()
long_name
and units
lost on ~~.lost()
~~ .mean()
long_name
and units
lost on .mean()
Ah. So this is intentional. There is an optional parameter that lets you control this -- try The basic problem is that it's ambiguous how to handle attributes like units after doing computation. I don't want to inspect attributes and choose some to preserve and others to remove, so we have a choice of either preserving all attributes in an operation or removing all of them. Obviously, for some aggregations (e.g., |
That makes sense. Great that there is an option to |
When reading in a variable from netCDF, the standard attributes like
long_name
,standard_name
, andunits
are being propagated, but apparently lost when calling.load()
.mean()
on theDataArray
.Couldn't these CF-Highly Recommended Variable Attributes be kept during this operation?
(What to do with them afterwards, e.g. upon merge, is a different question, unresolved also in the pandas community.)
EDIT: the problem actually occurs when calling
.mean()
(not.load()
, as originally posted).The text was updated successfully, but these errors were encountered: