xarray.Variable.set_dims

xarray.Variable.set_dims#

Variable.set_dims(dim, shape=None)[source]#

Return a new variable with given set of dimensions. This method might be used to attach new dimension(s) to variable.

When possible, this operation does not copy this variable’s data.

Parameters

dim (str or sequence of str or dict) – Dimensions to include on the new variable. If a dict, values are used to provide the sizes of new dimensions; otherwise, new dimensions are inserted with length 1.

Returns

Variable