You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I need to create a "semi month" feature for semi-monthly data. Just like "week" but for semi-months instead of weeks.
I'd like to have "semi_month" features, for example the 1st of January would be semi_week 1. The 18th of January would be semi_week 2. The 3rd of March would be semi_week 5. Basically you split each month into two semi months and you get 24 semi-months.
In order to be consistent with the SM and SMS pandas frequencies I'd consider:
semi_month_start:
Days 1 to 14 included: first half
Days 15 to end of month included: second half
semi_month_end:
Days 1 to 15 included: first_half
Days 16 to end of month included: second half
So, for example, with "semi_month_start", the 15th of February is semi_month 4, while for "semi_month_end" it is semi_month 3.
Describe alternatives you've considered
The only alternative is to have 2 different features for month and day.
P.S.
The feature functions could be something like this:
Is your feature request related to a problem? Please describe.
I need to create a "semi month" feature for semi-monthly data. Just like "week" but for semi-months instead of weeks.
Describe the solution you'd like
Pandas supports "SM" (semi-montly, i.e. 15th and end of month) and "SMS" (semi-montly start, i.e. 1st and 15th of the month) frequencies, see: https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases
I'd like to have "semi_month" features, for example the 1st of January would be semi_week 1. The 18th of January would be semi_week 2. The 3rd of March would be semi_week 5. Basically you split each month into two semi months and you get 24 semi-months.
In order to be consistent with the SM and SMS pandas frequencies I'd consider:
semi_month_start:
semi_month_end:
So, for example, with "semi_month_start", the 15th of February is semi_month 4, while for "semi_month_end" it is semi_month 3.
Describe alternatives you've considered
The only alternative is to have 2 different features for month and day.
P.S.
The feature functions could be something like this:
The text was updated successfully, but these errors were encountered: