a2rl.read_csv_dataset#

a2rl.read_csv_dataset(dirpath, *args, test_mdp=False, low_memory=False, **kwargs)[source]#

Read a dataset directory into a a2rl.WiDataFrame.

Parameters:
  • dirpath (str | PathLike[str]) – Path to the dataset directory.

  • *args – Positional arguments passed as-is to pandas.read_csv().

  • mdp_test – When True, perform Markovian self-check on the dataframe loaded. Raise a2rl.utils.NotMDPDataError if the check fails.

  • low_memory (bool) – If False, read the entire .csv payload. If True, internally process the .csv payload in chunks. This argument is passed as-is to pandas.read_csv(), however note that we override the default to True, which is opposite to the default in pandas.read_csv().

  • **kwargs – Keyword arguments passed as-is to pandas.read_csv().

Return type:

WiDataFrame

Returns:

The loaded dataset.

Examples

>>> import a2rl as wi
>>> p = wi.sample_dataset_path('chiller')
>>> df = wi.read_csv_dataset(p)
>>> df.info()  
<class 'a2rl._dataframe.WiDataFrame'>
RangeIndex: 9153 entries, 0 to 9152
Data columns (total 5 columns):
 #   Column                    Non-Null Count  Dtype
---  ------                    --------------  -----
 0   timestamp                 9153 non-null   object
 1   staging                   9153 non-null   object
 2   condenser_inlet_temp      9153 non-null   float64
 3   evaporator_heat_load_rt   9153 non-null   float64
 4   system_power_consumption  9153 non-null   float64
dtypes: float64(3), object(2)
memory usage: ... KB