We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 445484c commit 68519b6Copy full SHA for 68519b6
bisect/46218.py
@@ -0,0 +1,18 @@
1
+# BUG: pd.cut regression starting in version 1.4.0 when operating on datetime #46218
2
+
3
+import pandas as pd
4
5
+print(pd.__version__)
6
7
+idx = pd.interval_range(
8
+ pd.Timestamp("2022-02-25"),
9
+ pd.Timestamp("2022-02-27"),
10
+ freq="1D",
11
+)
12
13
+result = pd.cut(pd.Series([pd.Timestamp("2022-02-26")]), bins=idx).value_counts()
14
+print(result)
15
16
+dtype = pd.CategoricalDtype(idx, ordered=True)
17
+expected = pd.Series([1, 0], index=idx.astype(dtype))
18
+pd.testing.assert_series_equal(result, expected)
0 commit comments