Skip to content

Commit b6564dc

Browse files
committed
Fix randomly failing test in test_frame.py
1 parent ff090f4 commit b6564dc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/tests/test_frame.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1938,7 +1938,11 @@ def verify(df, level, idx, indexer):
19381938
'joe':['3rd'] * 2 + ['1st'] * 3 + ['2nd'] * 3 +
19391939
['1st'] * 2 + ['3rd'] * 3 + ['1st'] * 2 +
19401940
['3rd'] * 3 + ['2nd'] * 2,
1941-
'jolie':np.random.randint(0, 1000, 20),
1941+
# this needs to be jointly unique with jim and joe or
1942+
# reindexing will fail ~1.5% of the time, this works
1943+
# out to needing unique groups of same size as joe
1944+
'jolie': np.concatenate([np.random.choice(1000, x, replace=False)
1945+
for x in [2, 3, 3, 2, 3, 2, 3, 2]]),
19421946
'joline': np.random.randn(20).round(3) * 10})
19431947

19441948
for idx in permutations(df['jim'].unique()):

0 commit comments

Comments
 (0)