Closed jeff-hernandez closed 4 years ago
it seems to me window size can be
I think the case where it is an amount of time is easy because it's just <VALUE><SPACE><UNIT>
.
the until case is a little tougher, but perhaps we start by just hardcoding some common patterns. anything more complex, you'd have to use pandas offsets
Until start of next <UNIT>
Okay, sounds good. Will start with this template.
until start of next <unit>
Then maybe later can be:
until start of next <value><space><unit>
There are offsets available for these time spans.
'Until start of next year' # -> pd.offsets.YearBegin
'Until start of next month' # -> pd.offsets.MonthBegin
However, I didn't see any for these.
Until start of next week
Until start of next day
Until start of next hour
Offset aliases are not user friendly. Would be helpful to create a mapping to easily specify which offset to use. Couple suggestion in the examples below.
lm = cp.LabelMaker( window_size=first_of_every.months(2), ... )