marmot.plottingmodules.plotutils.timeseries_modifiers.set_timestamp_date_range#

set_timestamp_date_range(dfs: Union[pandas.core.frame.DataFrame, List[pandas.core.frame.DataFrame]], start_date: str, end_date: str) Union[pandas.core.frame.DataFrame, Tuple[pandas.core.frame.DataFrame, ...]][source]#

Sets the timestamp date range based on start_date and end_date strings

Takes either a single df or a list of dfs as input. The index must be a pd.DatetimeIndex or a multiindex with level timestamp.

Parameters
  • dfs (Union[pd.DataFrame, List[pd.DataFrame]]) – df(s) to set date range for

  • start_date (str) – start date

  • end_date (str) – end date

Raises

ValueError – If df.index is not of type type pd.DatetimeIndex or type pd.MultiIndex with level timestamp.

Returns

adjusted dataframes

Return type

pd.DataFrame or Tuple[pd.DataFrame]