WrightTools.data.Data.create_variable

Data.create_variable(name, values=None, *, shape=None, units=None, dtype=None, **kwargs) → WrightTools.data._variable.Variable[source]

Add new child variable.

Parameters
  • name (string) – Unique identifier.

  • values (array-like (optional)) – Array to populate variable with. If None, an variable will be filled with NaN. Default is None.

  • shape (tuple of int) – Shape to use. must broadcast with the full shape. Only used if values is None. Default is the full shape of self.

  • units (string (optional)) – Variable units. Default is None.

  • dtype (numpy.dtype (optional)) – dtype to use for dataset, default is np.float64. Only used if values is None.

  • kwargs – Additional kwargs to variable instantiation.

Returns

New child variable.

Return type

WrightTools Variable