We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da0156a commit adcf608Copy full SHA for adcf608
pandas/tests/tseries/frequencies/test_freq_code.py
@@ -6,6 +6,7 @@
6
to_offset,
7
)
8
from pandas._libs.tslibs.dtypes import _attrname_to_abbrevs
9
+from numpy import datetime64
10
11
12
@pytest.mark.parametrize(
@@ -78,3 +79,20 @@ def test_cat(args):
78
79
80
with pytest.raises(ValueError, match=msg):
81
to_offset(str(args[0]) + args[1])
82
+
83
+@pytest.mark.parametrize(
84
+ 'freqstr,expected',
85
+ [
86
+ ('1H','2021-01-01T09:00:00'),
87
+ ('1D','2021-01-01T08:00:00'),
88
+ ('1W','2021-01-03T08:00:00'),
89
+ ('1M','2021-01-31T08:00:00'),
90
+ ('1Y','2021-12-31T08:00:00')
91
+ ]
92
+)
93
+def test_compatibility(freqstr,expected):
94
+ ts_np = datetime64('2021-01-01T08:00:00.00')
95
+ do = to_offset(freqstr)
96
97
+ assert ts_np + do == datetime64(expected)
98
0 commit comments