Skip to content

Commit dd810a8

Browse files
code sample for pandas-dev#42104
1 parent eb82913 commit dd810a8

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

bisect/42104.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# BUG: DatetimeIndex.intersection gives incorrect result #42104
2+
3+
import pandas as pd
4+
5+
print(pd.__version__)
6+
7+
index = pd.DatetimeIndex(
8+
[
9+
"2018-12-31",
10+
"2019-03-31",
11+
"2019-06-30",
12+
"2019-09-30",
13+
"2019-12-31",
14+
"2020-03-31",
15+
],
16+
freq="Q-DEC",
17+
)
18+
19+
result = index[::2].intersection(index[1::2])
20+
print(result)
21+
22+
assert not len(result)

0 commit comments

Comments
 (0)