Skip to content

Commit ac2b9ea

Browse files
code sample for pandas-dev#46702
1 parent f95a7eb commit ac2b9ea

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

bisect/46702.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# BUG: DatetimeIndex.intersection not working for localized indices #46702
2+
3+
import pandas as pd
4+
5+
print(pd.__version__)
6+
7+
i1 = pd.date_range("2020-03-27", periods=5, freq="D", tz="Europe/Berlin")
8+
i2 = pd.date_range("2020-03-30", periods=5, freq="D", tz="Europe/Berlin")
9+
result = i1.intersection(i2)
10+
print(result)
11+
12+
expected = pd.date_range("2020-03-30", periods=2, freq="D", tz="Europe/Berlin")
13+
pd.testing.assert_index_equal(result, expected)

0 commit comments

Comments
 (0)