Skip to content

Commit 54db0b2

Browse files
committed
merge with master
2 parents 80842a1 + f0d57d9 commit 54db0b2

File tree

111 files changed

+1665
-592
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+1665
-592
lines changed

asv_bench/benchmarks/tslibs/period.py

+42-18
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99

1010
from pandas.tseries.frequencies import to_offset
1111

12-
from .tslib import _sizes
12+
from .tslib import _sizes, _tzs
13+
14+
try:
15+
from pandas._libs.tslibs.vectorized import dt64arr_to_periodarr
16+
except ImportError:
17+
from pandas._libs.tslibs.period import dt64arr_to_periodarr
1318

1419

1520
class PeriodProperties:
@@ -75,26 +80,29 @@ def time_period_constructor(self, freq, is_offset):
7580
Period("2012-06-01", freq=freq)
7681

7782

83+
_freq_ints = [
84+
1000,
85+
1011, # Annual - November End
86+
2000,
87+
2011, # Quarterly - November End
88+
3000,
89+
4000,
90+
4006, # Weekly - Saturday End
91+
5000,
92+
6000,
93+
7000,
94+
8000,
95+
9000,
96+
10000,
97+
11000,
98+
12000,
99+
]
100+
101+
78102
class TimePeriodArrToDT64Arr:
79103
params = [
80104
_sizes,
81-
[
82-
1000,
83-
1011, # Annual - November End
84-
2000,
85-
2011, # Quarterly - November End
86-
3000,
87-
4000,
88-
4006, # Weekly - Saturday End
89-
5000,
90-
6000,
91-
7000,
92-
8000,
93-
9000,
94-
10000,
95-
11000,
96-
12000,
97-
],
105+
_freq_ints,
98106
]
99107
param_names = ["size", "freq"]
100108

@@ -104,3 +112,19 @@ def setup(self, size, freq):
104112

105113
def time_periodarray_to_dt64arr(self, size, freq):
106114
periodarr_to_dt64arr(self.i8values, freq)
115+
116+
117+
class TimeDT64ArrToPeriodArr:
118+
params = [
119+
_sizes,
120+
_freq_ints,
121+
_tzs,
122+
]
123+
param_names = ["size", "freq", "tz"]
124+
125+
def setup(self, size, freq, tz):
126+
arr = np.arange(10, dtype="i8").repeat(size // 10)
127+
self.i8values = arr
128+
129+
def time_dt64arr_to_periodarr(self, size, freq, tz):
130+
dt64arr_to_periodarr(self.i8values, freq, tz)

ci/deps/azure-36-32bit.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ dependencies:
2323
- pip
2424
- pip:
2525
- cython>=0.29.16
26-
- pytest>=5.0.1
26+
- pytest>=5.0.1,<6.0.0rc0

ci/deps/azure-36-locale.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77

88
# tools
99
- cython>=0.29.16
10-
- pytest>=5.0.1
10+
- pytest>=5.0.1,<6.0.0rc0
1111
- pytest-xdist>=1.21
1212
- pytest-asyncio
1313
- hypothesis>=3.58.0

ci/deps/azure-36-locale_slow.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77

88
# tools
99
- cython>=0.29.16
10-
- pytest>=5.0.1
10+
- pytest>=5.0.1,<6.0.0rc0
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313
- pytest-azurepipelines

ci/deps/azure-36-slow.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77

88
# tools
99
- cython>=0.29.16
10-
- pytest>=5.0.1
10+
- pytest>=5.0.1,<6.0.0rc0
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313

ci/deps/azure-37-locale.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66

77
# tools
88
- cython>=0.29.16
9-
- pytest>=5.0.1
9+
- pytest>=5.0.1,<6.0.0rc0
1010
- pytest-xdist>=1.21
1111
- pytest-asyncio
1212
- hypothesis>=3.58.0

ci/deps/azure-37-numpydev.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dependencies:
55
- python=3.7.*
66

77
# tools
8-
- pytest>=5.0.1
8+
- pytest>=5.0.1,<6.0.0rc0
99
- pytest-xdist>=1.21
1010
- hypothesis>=3.58.0
1111
- pytest-azurepipelines

ci/deps/azure-macos-36.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dependencies:
55
- python=3.6.*
66

77
# tools
8-
- pytest>=5.0.1
8+
- pytest>=5.0.1,<6.0.0rc0
99
- pytest-xdist>=1.21
1010
- hypothesis>=3.58.0
1111
- pytest-azurepipelines

ci/deps/azure-windows-36.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77

88
# tools
99
- cython>=0.29.16
10-
- pytest>=5.0.1
10+
- pytest>=5.0.1,<6.0.0rc0
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313
- pytest-azurepipelines

ci/deps/azure-windows-37.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77

88
# tools
99
- cython>=0.29.16
10-
- pytest>=5.0.1
10+
- pytest>=5.0.1,<6.0.0rc0
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313
- pytest-azurepipelines

ci/deps/travis-36-cov.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77

88
# tools
99
- cython>=0.29.16
10-
- pytest>=5.0.1
10+
- pytest>=5.0.1,<6.0.0rc0
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313
- pytest-cov # this is only needed in the coverage build

ci/deps/travis-36-locale.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77

88
# tools
99
- cython>=0.29.16
10-
- pytest>=5.0.1
10+
- pytest>=5.0.1,<6.0.0rc0
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313

ci/deps/travis-37-arm64.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77

88
# tools
99
- cython>=0.29.13
10-
- pytest>=5.0.1
10+
- pytest>=5.0.1,<6.0.0rc0
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313

ci/deps/travis-37.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77

88
# tools
99
- cython>=0.29.16
10-
- pytest>=5.0.1
10+
- pytest>=5.0.1,<6.0.0rc0
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313

ci/deps/travis-38.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77

88
# tools
99
- cython>=0.29.16
10-
- pytest>=5.0.1
10+
- pytest>=5.0.1,<6.0.0rc0
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313

doc/source/reference/offset_frequency.rst

+18
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Methods
3333
:toctree: api/
3434

3535
DateOffset.apply
36+
DateOffset.apply_index
3637
DateOffset.copy
3738
DateOffset.isAnchored
3839
DateOffset.onOffset
@@ -117,6 +118,7 @@ Methods
117118
:toctree: api/
118119

119120
BusinessHour.apply
121+
BusinessHour.apply_index
120122
BusinessHour.copy
121123
BusinessHour.isAnchored
122124
BusinessHour.onOffset
@@ -201,6 +203,7 @@ Methods
201203
:toctree: api/
202204

203205
CustomBusinessHour.apply
206+
CustomBusinessHour.apply_index
204207
CustomBusinessHour.copy
205208
CustomBusinessHour.isAnchored
206209
CustomBusinessHour.onOffset
@@ -401,6 +404,7 @@ Methods
401404
:toctree: api/
402405

403406
CustomBusinessMonthEnd.apply
407+
CustomBusinessMonthEnd.apply_index
404408
CustomBusinessMonthEnd.copy
405409
CustomBusinessMonthEnd.isAnchored
406410
CustomBusinessMonthEnd.onOffset
@@ -447,6 +451,7 @@ Methods
447451
:toctree: api/
448452

449453
CustomBusinessMonthBegin.apply
454+
CustomBusinessMonthBegin.apply_index
450455
CustomBusinessMonthBegin.copy
451456
CustomBusinessMonthBegin.isAnchored
452457
CustomBusinessMonthBegin.onOffset
@@ -586,6 +591,7 @@ Methods
586591
:toctree: api/
587592

588593
WeekOfMonth.apply
594+
WeekOfMonth.apply_index
589595
WeekOfMonth.copy
590596
WeekOfMonth.isAnchored
591597
WeekOfMonth.onOffset
@@ -622,6 +628,7 @@ Methods
622628
:toctree: api/
623629

624630
LastWeekOfMonth.apply
631+
LastWeekOfMonth.apply_index
625632
LastWeekOfMonth.copy
626633
LastWeekOfMonth.isAnchored
627634
LastWeekOfMonth.onOffset
@@ -938,6 +945,7 @@ Methods
938945
:toctree: api/
939946

940947
FY5253.apply
948+
FY5253.apply_index
941949
FY5253.copy
942950
FY5253.get_rule_code_suffix
943951
FY5253.get_year_end
@@ -977,6 +985,7 @@ Methods
977985
:toctree: api/
978986

979987
FY5253Quarter.apply
988+
FY5253Quarter.apply_index
980989
FY5253Quarter.copy
981990
FY5253Quarter.get_rule_code_suffix
982991
FY5253Quarter.get_weeks
@@ -1013,6 +1022,7 @@ Methods
10131022
:toctree: api/
10141023

10151024
Easter.apply
1025+
Easter.apply_index
10161026
Easter.copy
10171027
Easter.isAnchored
10181028
Easter.onOffset
@@ -1053,6 +1063,7 @@ Methods
10531063
Tick.is_on_offset
10541064
Tick.__call__
10551065
Tick.apply
1066+
Tick.apply_index
10561067

10571068
Day
10581069
---
@@ -1087,6 +1098,7 @@ Methods
10871098
Day.is_on_offset
10881099
Day.__call__
10891100
Day.apply
1101+
Day.apply_index
10901102

10911103
Hour
10921104
----
@@ -1121,6 +1133,7 @@ Methods
11211133
Hour.is_on_offset
11221134
Hour.__call__
11231135
Hour.apply
1136+
Hour.apply_index
11241137

11251138
Minute
11261139
------
@@ -1155,6 +1168,7 @@ Methods
11551168
Minute.is_on_offset
11561169
Minute.__call__
11571170
Minute.apply
1171+
Minute.apply_index
11581172

11591173
Second
11601174
------
@@ -1189,6 +1203,7 @@ Methods
11891203
Second.is_on_offset
11901204
Second.__call__
11911205
Second.apply
1206+
Second.apply_index
11921207

11931208
Milli
11941209
-----
@@ -1223,6 +1238,7 @@ Methods
12231238
Milli.is_on_offset
12241239
Milli.__call__
12251240
Milli.apply
1241+
Milli.apply_index
12261242

12271243
Micro
12281244
-----
@@ -1257,6 +1273,7 @@ Methods
12571273
Micro.is_on_offset
12581274
Micro.__call__
12591275
Micro.apply
1276+
Micro.apply_index
12601277

12611278
Nano
12621279
----
@@ -1291,6 +1308,7 @@ Methods
12911308
Nano.is_on_offset
12921309
Nano.__call__
12931310
Nano.apply
1311+
Nano.apply_index
12941312

12951313
.. _api.frequencies:
12961314

0 commit comments

Comments
 (0)