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
Closed

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

ijmcf opened this issue Oct 25, 2012 · 1 comment
Labels
Bug Datetime Datetime data dtype
Milestone

Comments

@ijmcf
Copy link

ijmcf 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
Copy link
Contributor

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
* 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 as completed Nov 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype
Projects
None yet
Development

No branches or pull requests

3 participants