diff --git a/pandas/tests/test_frame.py b/pandas/tests/test_frame.py index fcbfb21bd20e3..777fc6d68f3cd 100644 --- a/pandas/tests/test_frame.py +++ b/pandas/tests/test_frame.py @@ -1938,7 +1938,11 @@ def verify(df, level, idx, indexer): 'joe':['3rd'] * 2 + ['1st'] * 3 + ['2nd'] * 3 + ['1st'] * 2 + ['3rd'] * 3 + ['1st'] * 2 + ['3rd'] * 3 + ['2nd'] * 2, - 'jolie':np.random.randint(0, 1000, 20), + # this needs to be jointly unique with jim and joe or + # reindexing will fail ~1.5% of the time, this works + # out to needing unique groups of same size as joe + 'jolie': np.concatenate([np.random.choice(1000, x, replace=False) + for x in [2, 3, 3, 2, 3, 2, 3, 2]]), 'joline': np.random.randn(20).round(3) * 10}) for idx in permutations(df['jim'].unique()):