+ '''
+ Generate a pandas dataframe from a dictionary of features per datetime, which
+ respects the starting and ending dates of the study, and its precision (the
+ time step) as passed to the constructor. Missing feature values are completed.
+
+ - Missing datetimes are added first with np.NaN feature values,
+ - The dataframe is then constructed based on the filled feature dictionary,
+ - NaN values are then filled with last known values.
+ '''
+
+ def __init__(self, config_file = None, dict_features = None, features = None):
+ '''
+ Constructor that defines all needed attributes and collects features.
+ '''
+ self._config = ConfigParser()
+ self._config.read(config_file)
+
+ self._start = datetime.strptime(self._config['DATETIME']['start'],
+ '%m/%d/%Y %H:%M:%S')
+ self._end = datetime.strptime(self._config['DATETIME']['end'],
+ '%m/%d/%Y %H:%M:%S')
+ self._timestep = timedelta(hours =
+ self._config['DATETIME'].getfloat('hourStep'))