()
| 2503 | |
| 2504 | |
| 2505 | def test_sample_without_replacement(): |
| 2506 | df = pd.DataFrame( |
| 2507 | {"x": [1, 2, 3, 4, None, 6], "y": list("abdabd")}, |
| 2508 | index=[10, 20, 30, 40, 50, 60], |
| 2509 | ) |
| 2510 | a = dd.from_pandas(df, 2) |
| 2511 | b = a.sample(frac=0.7, replace=False) |
| 2512 | bb = b.index.compute() |
| 2513 | assert len(bb) == len(set(bb)) |
| 2514 | |
| 2515 | |
| 2516 | def test_sample_raises(): |