Skip to content

Commit 4b6eefb

Browse files
committed
TST: (GH4550) where with a dup index in Series
1 parent 7beb06c commit 4b6eefb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pandas/tests/test_series.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,6 +1373,15 @@ def test_where_inplace(self):
13731373
rs.where(cond, -s, inplace=True)
13741374
assert_series_equal(rs, s.where(cond, -s))
13751375

1376+
def test_where_dups(self):
1377+
# GH 4550
1378+
# where crashes with dups in index
1379+
s1 = Series(range(3))
1380+
s2 = Series(range(3))
1381+
comb = pd.concat([s1,s2])
1382+
result = comb.where(comb < 2)
1383+
expected = Series([0,1,np.nan,0,1,np.nan],index=[0,1,2,0,1,2])
1384+
13761385
def test_mask(self):
13771386
s = Series(np.random.randn(5))
13781387
cond = s > 0

0 commit comments

Comments
 (0)