BUG: end_time for Period with multiplied freq #11738

Closed
pajachiet opened this Issue Dec 2, 2015 · 3 comments

Comments

Projects
None yet
3 participants

end_time of a Period with multiplied freq is the square of the multiplication

>>> pd.__version__
u'0.17.0'

>>> p = pd.Period('2015-08-01', freq='3D')
>>> p.end_time, p.to_timestamp(how='E')
(Timestamp('2015-08-09 23:59:59.999999999'), Timestamp('2015-08-03 00:00:00'))

>>> p = pd.Period('2015-08-01', freq='5D')
>>> p.end_time, p.to_timestamp(how='E')
(Timestamp('2015-08-25 23:59:59.999999999'), Timestamp('2015-08-05 00:00:00'))
Contributor

jreback commented Dec 2, 2015

yep, should be (p+1).start_time.value-1 in src/period.pyx/Period/end_time

jreback added this to the 0.18.0 milestone Dec 2, 2015

Contributor

srib commented Dec 6, 2015

Please review and merge PR #11771.

@jreback jreback added a commit that referenced this issue Dec 7, 2015

@srib @jreback srib + jreback BUG: Fix for Period.end_time when multiple of a frequency is requested,
#11738

1. Added a new test with the multiple of a frequency.
2. Rearranged some tests to improve readability of the code.
3. Added bug fix to whatsnew
4. Added a comment in the test
4fbf5e5
Contributor

jreback commented Dec 7, 2015

closed by #11779

jreback closed this Dec 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment