Skip to content
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

Period.end_time is incorrect when period is W or longer #2125

Closed
ijmcf opened this issue Oct 25, 2012 · 1 comment

Comments

@ijmcf
Copy link

commented Oct 25, 2012

For example:

p = pandas.Period('2012', freq='M')
p.end_time
<Timestamp: 2012-01-31 00:00:00>

This is the start of the last day of the month. So if one were using this in code, you could erroneously find that any datetime on January 31st is after the end of the month of January, for example:

datetime.datetime(2012, 1, 31, 12) > p.end_time
True

@changhiskhan

This comment has been minimized.

Copy link
Contributor

commented Oct 25, 2012

yeah for W or longer the end_time returns the last day. Originally I thought this was closer to common usage cases which I made it that way. Though perhaps it's better to make the default nanosecond resolution and use to_timestamp to explicitly convert to other frequencies.

@ghost ghost assigned changhiskhan Nov 2, 2012

wesm added a commit that referenced this issue Nov 4, 2012
Merge remote branch 'chang/to-timestamp'
* chang/to-timestamp:
  BUG: add same to_timestamp change to PeriodIndex
  BUG: change default frequency for to_timestamp
  BUG: start_time end_time to_timestamp bugs #2124 #2125 #1764

@wesm wesm closed this Nov 4, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.