Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
The current implementation of FY5253Quarter assumes that quarters have an even distribution of weeks, for a total of 13 weeks per quarter except in the event of a 53 week year, in which case a designated quarter will consist of a total of 14 weeks.
It is sometimes the case the companies elect to use quarters with an alternative allocation of weeks, the alternative often being 16-12-12-12.
I propose the addition of an optional argument called quarter_lengths that accepts an input of Tuple[int, int, int, int] where sum(quarter_lengths) == 52.
Feature Description
In addition to modifying the interface to include the extra parameter, I think this can be accomplished with a very simple change to the existing get_weeks function:
Feature Type
[X] Adding new functionality to pandas
[ ] Changing existing functionality in pandas
[ ] Removing existing functionality in pandas
Problem Description
The current implementation of FY5253Quarter assumes that quarters have an even distribution of weeks, for a total of 13 weeks per quarter except in the event of a 53 week year, in which case a designated quarter will consist of a total of 14 weeks.
It is sometimes the case the companies elect to use quarters with an alternative allocation of weeks, the alternative often being 16-12-12-12.
I propose the addition of an optional argument called
quarter_lengths
that accepts an input ofTuple[int, int, int, int]
wheresum(quarter_lengths) == 52
.Feature Description
In addition to modifying the interface to include the extra parameter, I think this can be accomplished with a very simple change to the existing
get_weeks
function:https://github.com/pandas-dev/pandas/blob/main/pandas/_libs/tslibs/offsets.pyx#L4052C1-L4060C19
Alternative Solutions
n/a
Additional Context
Example 10-k describing this pattern