Open aulemahal opened 5 years ago
This looks to work on main now. Could use a test
take
This looks to work on main now. Could use a test
I am currently using version 2.0.1 of Pandas and this specific problem isn’t fixed.
take
Did some digging and i think it is because of the implementation of offset. rollback
and rollforward
do not take n
into account.
offset = QuarterBegin(startingMonth=1, n=2) #2QS
dt = pd.Timestamp("1950-01-02")
offset.rollback(dt), offset.rollforward(dt)
and
offset = QuarterBegin(startingMonth=1, n=1) #QS
dt = pd.Timestamp("1950-01-02")
offset.rollback(dt), offset.rollforward(dt)
both return (Timestamp('1950-01-01 00:00:00'), Timestamp('1950-04-01 00:00:00'))
.
@mroeschke please confirm if this is expected or not.
take
Code Sample
returns:
But as I explicitly asked for 2 Quarters starting in March, I expected:
So, when specifying a multiple, the first time still goes to the closest single quarter before.
Not really a duplicate, but closely related to #22362.
Output of
pd.show_versions()