DataService

class larch.DataService

An object that implements the DataService interface must provide these methods.

make_dataframes(req_data, *, selector=None, float_dtype=numpy.float64)

Create a DataFrames object that will satisfy a data request.

Parameters:
  • req_data (Dict or str) – The requested data. The keys for this dictionary may include {‘ca’, ‘co’, ‘choice_ca’, ‘choice_co’, ‘weight_co’, ‘avail_ca’, ‘standardize’}. Currently, the keys {‘choice_co_code’, ‘avail_co’} are not implemented and will raise an error. Other keys are silently ignored.
  • selector (array-like[bool] or slice, optional) – If given, the selector filters the cases. This argument can only be given as a keyword argument.
  • float_dtype (dtype, default float64) – The dtype to use for all float-type arrays. Note that the availability arrays are always returned as int8 regardless of the float type. This argument can only be given as a keyword argument.
Return type:

DataFrames

Returns:

This object should satisfy the request.