-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Remove property that re-computed microsecond #17331
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
48a5923
Remove property that re-computed microsecond;
jbrockmendel aba4053
Add asv for timestamp property access
jbrockmendel 26c0980
whatsnew note in Performance Imrpovements
jbrockmendel 7af49ee
flake8 whitespace fixup
jbrockmendel c98663e
dummy commit to force CI
jbrockmendel 9919df4
rst fixup, add GH reference
jbrockmendel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
from .pandas_vb_common import * | ||
from pandas import to_timedelta, Timestamp | ||
|
||
|
||
class TimestampProperties(object): | ||
goal_time = 0.2 | ||
|
||
def setup(self): | ||
self.ts = Timestamp('2017-08-25 08:16:14') | ||
|
||
def time_tz(self): | ||
self.ts.tz | ||
|
||
def time_offset(self): | ||
self.ts.offset | ||
|
||
def time_dayofweek(self): | ||
self.ts.dayofweek | ||
|
||
def time_weekday_name(self): | ||
self.ts.weekday_name | ||
|
||
def time_dayofyear(self): | ||
self.ts.dayofyear | ||
|
||
def time_week(self): | ||
self.ts.week | ||
|
||
def time_quarter(self): | ||
self.ts.quarter | ||
|
||
def time_days_in_month(self): | ||
self.ts.days_in_month | ||
|
||
def time_freqstr(self): | ||
self.ts.freqstr | ||
|
||
def time_is_month_start(self): | ||
self.ts.is_month_start | ||
|
||
def time_is_month_end(self): | ||
self.ts.is_month_end | ||
|
||
def time_is_quarter_start(self): | ||
self.ts.is_quarter_start | ||
|
||
def time_is_quarter_end(self): | ||
self.ts.is_quarter_end | ||
|
||
def time_is_year_start(self): | ||
self.ts.is_quarter_end | ||
|
||
def time_is_year_end(self): | ||
self.ts.is_quarter_end | ||
|
||
def time_is_leap_year(self): | ||
self.ts.is_quarter_end | ||
|
||
def time_microsecond(self): | ||
self.ts.microsecond |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# -*- coding: utf-8 -*- | ||
from datetime import datetime, date, timedelta | ||
import operator | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the PR number as the issue. we always want a reference to an entry in whatsnew (issue preferd, or PR if not avail).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
either use double-backticks, or
:attr:`Timestamp.microsecond`
(in general prefer the api references). I don't think this API reference will actually work ATM asTimestamp
is not defined in api.rst (so separate issue to rectify that).