-
-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add semi_month to Datetime Features #685
Comments
Thank you for the suggestion @candalfigomoro If you'd like to make a PR to add the requested functionality, that would be great! Otherwise, we will pick this up later. Thank you! |
Hey @solegalli if this is till open, I can give it a try :-) of course, if it is ok for you @candalfigomoro |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: