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
My inclination is no: the contents of a Dataset (e.g., list(ds), ds.keys() and ds.values()) should only include non-coordinates.
__contains__ checks for a coordinate (e.g., 'time') would need to look in ds.dimensions or ds.coordinates instead of ds, but I see no need to __getitem__: ds['time'] can still work.
Pluses:
This change would more closely align xray.Dataset with pandas.DataFrame, which also does not include any elements of the index in the contents of the frame.
It would eliminate the need for using ds.noncoordinates -- which, as @ToddSmall has pointed out, is not very intuitive.
In my experience, I have been using ds.noncoordinates.items() more often than ds.items() (which contains redundant information, as coordinates are repeated). The only time I really want to iterate over all variables in a dataset is when I'm using the lower level Variable API.
Negatives:
This would break the existing API.
The text was updated successfully, but these errors were encountered:
My inclination is no: the contents of a Dataset (e.g.,
list(ds)
,ds.keys()
andds.values()
) should only include non-coordinates.__contains__
checks for a coordinate (e.g.,'time'
) would need to look inds.dimensions
ords.coordinates
instead ofds
, but I see no need to__getitem__
:ds['time']
can still work.Pluses:
xray.Dataset
withpandas.DataFrame
, which also does not include any elements of the index in the contents of the frame.ds.noncoordinates
-- which, as @ToddSmall has pointed out, is not very intuitive.ds.noncoordinates.items()
more often thands.items()
(which contains redundant information, as coordinates are repeated). The only time I really want to iterate over all variables in a dataset is when I'm using the lower levelVariable
API.Negatives:
The text was updated successfully, but these errors were encountered: