Skip to content

Commit

Permalink
code sample for pandas-dev#43240
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjayhawkins committed Aug 27, 2021
1 parent 2b2e7cc commit 03b7211
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions bisect/43240.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# BUG: RangeIndex.where throws AssertionError #43240

import numpy as np

import pandas as pd

print(pd.__version__)

idx = pd.RangeIndex(0, 5)
v = np.array([False, False, True, True, True])

result = idx.where(v, 10)
print(result)

expected = pd.Index([10, 10, 2, 3, 4], dtype="int64")

pd.testing.assert_index_equal(result, expected)

0 comments on commit 03b7211

Please sign in to comment.