from_dict
- classmethod UnitsAwareDataArray.from_dict(d: dict) xarray.core.dataarray.DataArray
Convert a dictionary into an xarray.DataArray
Input dict can take several forms:
d = {"dims": ("t"), "data": x} d = { "coords": {"t": {"dims": "t", "data": t, "attrs": {"units": "s"}}}, "attrs": {"title": "air temperature"}, "dims": "t", "data": x, "name": "a", }
where “t” is the name of the dimension, “a” is the name of the array, and x and t are lists, numpy.arrays, or pandas objects.
- Parameters
d (dict) – Mapping with a minimum structure of {“dims”: […], “data”: […]}
- Returns
obj
- Return type
See also
DataArray.to_dict
,Dataset.from_dict