filter_idata_by_dates#

pymc_marketing.data.idata.utils.filter_idata_by_dates(idata, start_date=None, end_date=None)[source]#

Filter DataTree to a date range.

Parameters:
idataxr.DataTree

DataTree to filter

start_datestr or pd.Timestamp, optional

Start date (inclusive)

end_datestr or pd.Timestamp, optional

End date (inclusive)

Returns:
xr.DataTree

New DataTree with filtered groups

Examples

>>> filtered = filter_idata_by_dates(idata, "2024-01-01", "2024-12-31")