scipp.from_dict

scipp.from_dict(dict_obj)

Convert a python dict to a scipp Variable, DataArray or Dataset. If the input keys contain both ‘coords’ and ‘data’, then a DataArray is returned. If the input keys contain both ‘dims’ and ‘values’, as Variable is returned. Otherwise, a Dataset is returned.

Parameters

dict_obj (dict) – A python dict to be converted to a scipp object.

Returns

A scipp Variable, DataArray or Dataset.

Return type

VariableLike