Skip to content

Commit 03b7211

Browse files
code sample for pandas-dev#43240
1 parent 2b2e7cc commit 03b7211

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

bisect/43240.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# BUG: RangeIndex.where throws AssertionError #43240
2+
3+
import numpy as np
4+
5+
import pandas as pd
6+
7+
print(pd.__version__)
8+
9+
idx = pd.RangeIndex(0, 5)
10+
v = np.array([False, False, True, True, True])
11+
12+
result = idx.where(v, 10)
13+
print(result)
14+
15+
expected = pd.Index([10, 10, 2, 3, 4], dtype="int64")
16+
17+
pd.testing.assert_index_equal(result, expected)

0 commit comments

Comments
 (0)