captest.capdata.CapData.filter_time

CapData.filter_time(start=None, end=None, drop=False, days=None, test_date=None, inplace=True, wrap_year=False)

Select data for a specified time period.

Parameters:
  • start (str or pd.Timestamp or None, default None) – Start date for data to be returned. If a string is passed it must be in format that can be converted by pandas.to_datetime. Not required if test_date and days arguments are passed. If not provided and days is also not provided, defaults to the first timestamp in data_filtered.

  • end (str or pd.Timestamp or None, default None) – End date for data to be returned. If a string is passed it must be in format that can be converted by pandas.to_datetime. Not required if test_date and days arguments are passed. If not provided and days is also not provided, defaults to the last timestamp in data_filtered.

  • drop (bool, default False) – Set to true to drop time period between start and end rather than keep it. Must supply start and end and wrap_year must be false.

  • days (int or None, default None) – Days in time period to be returned. Not required if start and end are specified.

  • test_date (str or pd.Timestamp or None, default None) – Must be format that can be converted by pandas.to_datetime. Not required if start and end are specified. Requires days argument. Time period returned will be centered on this date.

  • inplace (bool, default True) – If inplace is true, then function overwrites the filtered dataframe. If false returns a DataFrame.

  • wrap_year (bool, default False) – If true calls the wrap_year_end function. See wrap_year_end docstring for details. wrap_year_end was cntg_eoy prior to v0.7.0.