import numpy as np
import xarray as xr # html_repr branch
lon = np.array([[-99.83, -99.32, -99.56],
[-99.27, -99.39, -99.91],
[-99.79, -99.23, -99.42]])
lat = np.array([[ 42.25, 42.21, 42.82],
[ 42.91, 42.47, 42.71],
[ 42.63, 42.59, 42.29]])
ds = xr.Dataset(data_vars={'foo': (('x', 'y'), np.random.rand(3, 3))},
coords={
'x': [0, 1, 2], 'y': [0, 1, 2],
'lon': (('x', 'y'), lon, {'standard_name': 'longitude'}),
'lat': (('x', 'y'), lat, {'standard_name': 'latitude'})
},
attrs={'title': 'example dataset'})
ds
ds.foo
ds.foo.variable
ds.foo.x.variable
ds.foo.lat
xr.Dataset()
xr.DataArray(1)