File tree 4 files changed +62
-5
lines changed
4 files changed +62
-5
lines changed Original file line number Diff line number Diff line change
1
+ from .pandas_vb_common import *
2
+ from pandas import to_timedelta , Timestamp
3
+
4
+
5
+ class TimestampProperties (object ):
6
+ goal_time = 0.2
7
+
8
+ def setup (self ):
9
+ self .ts = Timestamp ('2017-08-25 08:16:14' )
10
+
11
+ def time_tz (self ):
12
+ self .ts .tz
13
+
14
+ def time_offset (self ):
15
+ self .ts .offset
16
+
17
+ def time_dayofweek (self ):
18
+ self .ts .dayofweek
19
+
20
+ def time_weekday_name (self ):
21
+ self .ts .weekday_name
22
+
23
+ def time_dayofyear (self ):
24
+ self .ts .dayofyear
25
+
26
+ def time_week (self ):
27
+ self .ts .week
28
+
29
+ def time_quarter (self ):
30
+ self .ts .quarter
31
+
32
+ def time_days_in_month (self ):
33
+ self .ts .days_in_month
34
+
35
+ def time_freqstr (self ):
36
+ self .ts .freqstr
37
+
38
+ def time_is_month_start (self ):
39
+ self .ts .is_month_start
40
+
41
+ def time_is_month_end (self ):
42
+ self .ts .is_month_end
43
+
44
+ def time_is_quarter_start (self ):
45
+ self .ts .is_quarter_start
46
+
47
+ def time_is_quarter_end (self ):
48
+ self .ts .is_quarter_end
49
+
50
+ def time_is_year_start (self ):
51
+ self .ts .is_quarter_end
52
+
53
+ def time_is_year_end (self ):
54
+ self .ts .is_quarter_end
55
+
56
+ def time_is_leap_year (self ):
57
+ self .ts .is_quarter_end
58
+
59
+ def time_microsecond (self ):
60
+ self .ts .microsecond
Original file line number Diff line number Diff line change @@ -382,7 +382,7 @@ Performance Improvements
382
382
383
383
- Improved performance of instantiating :class:`SparseDataFrame` (:issue:`16773`)
384
384
- :attr:`Series.dt` no longer performs frequency inference, yielding a large speedup when accessing the attribute (:issue:`17210`)
385
-
385
+ - :attr:`Timestamp.microsecond` no longer re-computes on attribute access (:issue:`17331`)
386
386
387
387
.. _whatsnew_0210.bug_fixes:
388
388
Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
1
2
from datetime import datetime, date, timedelta
2
3
import operator
3
4
Original file line number Diff line number Diff line change @@ -544,10 +544,6 @@ class Timestamp(_Timestamp):
544
544
545
545
weekofyear = week
546
546
547
- @property
548
- def microsecond (self ):
549
- return self ._get_field(' us' )
550
-
551
547
@property
552
548
def quarter (self ):
553
549
return self ._get_field(' q' )
You can’t perform that action at this time.
0 commit comments