MCPcopy Create free account
hub / github.com/dask/dask / test_sample_without_replacement

Function test_sample_without_replacement

dask/dataframe/tests/test_dataframe.py:2505–2513  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2503
2504
2505def 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
2516def test_sample_raises():

Callers

nothing calls this directly

Calls 3

setClass · 0.85
sampleMethod · 0.80
computeMethod · 0.45

Tested by

no test coverage detected