larch.Dataset.from_idco

larch.Dataset.from_idco

classmethod Dataset.from_idco(df, alts=None)[source]

Construct a Dataset from an idco-format DataFrame.

Parameters
  • df (DataFrame) – The input data should be an idco-format DataFrame, with the caseid’s in a single-level index,

  • alts (Mapping or array-like, optional) – If given as a mapping, links alternative codes to names. An array or list of integers gives codes for the alternatives, which are otherwise unnamed.

Returns

Dataset