Skip to content

Commit

Permalink
closes #3109 (#3114)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnpryer committed Apr 11, 2022
1 parent 5ed844f commit 8758a07
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 14 deletions.
8 changes: 0 additions & 8 deletions polars/polars-core/src/chunked_array/random.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,6 @@ mod test {
// default samples are random and don't require seeds
assert!(df.sample_n(3, false, None).is_ok());
assert!(df.sample_frac(0.4, false, None).is_ok());
assert!(!df
.sample_n(3, false, None)
.unwrap()
.frame_equal(&df.sample_n(3, false, None).unwrap()));
assert!(!df
.sample_frac(0.4, false, None)
.unwrap()
.frame_equal(&df.sample_frac(0.4, false, None).unwrap()));
// with seeding
assert!(df.sample_n(3, false, Some(0)).is_ok());
assert!(df.sample_frac(0.4, false, Some(0)).is_ok());
Expand Down
3 changes: 0 additions & 3 deletions py-polars/tests/test_df.py
Original file line number Diff line number Diff line change
Expand Up @@ -1697,9 +1697,6 @@ def test_is_unique() -> None:
def test_sample() -> None:
df = pl.DataFrame({"foo": [1, 2, 3], "bar": [6, 7, 8], "ham": ["a", "b", "c"]})

# by default samples should be random
assert df.sample(n=2) != df.sample(n=2)

assert df.sample(n=2, seed=0).shape == (2, 3)
assert df.sample(frac=0.4, seed=0).shape == (1, 3)

Expand Down
3 changes: 0 additions & 3 deletions py-polars/tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1116,9 +1116,6 @@ def test_dot() -> None:
def test_sample() -> None:
s = pl.Series("a", [1, 2, 3, 4, 5])

# by default samples should be random
assert s.sample(n=2) != s.sample(n=2)

assert len(s.sample(n=2, seed=0)) == 2
assert len(s.sample(frac=0.4, seed=0)) == 2

Expand Down

0 comments on commit 8758a07

Please sign in to comment.