Skip to content

Commit

Permalink
TST: use a fixed seed to have the same uniques across python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
jreback committed Feb 16, 2019
1 parent 29008f5 commit ce18ba2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pandas/tests/resample/test_datetime_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -1160,9 +1160,13 @@ def test_resample_nunique_with_date_gap():
@pytest.mark.parametrize('k', [10, 100, 1000])
def test_resample_group_info(n, k):
# GH10914

# use a fixed seed to always have the same uniques
prng = np.random.RandomState(1234)

dr = date_range(start='2015-08-27', periods=n // 10, freq='T')
ts = Series(np.random.randint(0, n // k, n).astype('int64'),
index=np.random.choice(dr, n))
ts = Series(prng.randint(0, n // k, n).astype('int64'),
index=prng.choice(dr, n))

left = ts.resample('30T').nunique()
ix = date_range(start=ts.index.min(), end=ts.index.max(),
Expand Down

0 comments on commit ce18ba2

Please sign in to comment.