Skip to content

BUG: end_time for Period with multiplied freq #11738

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

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

BUG: end_time for Period with multiplied freq #11738

pajachiet opened this issue Dec 2, 2015 · 3 comments
Labels
Bug Period Period data type
Milestone

Comments

@pajachiet
Copy link
Contributor

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'))
@jreback
Copy link
Contributor

jreback commented Dec 2, 2015

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

@jreback jreback added this to the 0.18.0 milestone Dec 2, 2015
@srib
Copy link
Contributor

srib commented Dec 6, 2015

Please review and merge PR #11771.

jreback pushed a commit that referenced this issue Dec 7, 2015
#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
@jreback
Copy link
Contributor

jreback commented Dec 7, 2015

closed by #11779

@jreback jreback closed this as completed Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Period Period data type
Projects
None yet
3 participants