MCPcopy
hub / github.com/dask/dask / test_sample

Function test_sample

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

Source from the content-addressed store, hash-verified

2483
2484
2485def test_sample():
2486 df = pd.DataFrame(
2487 {"x": [1, 2, 3, 4, None, 6], "y": list("abdabd")},
2488 index=[10, 20, 30, 40, 50, 60],
2489 )
2490 a = dd.from_pandas(df, 2)
2491
2492 b = a.sample(frac=0.5)
2493
2494 assert_eq(b, b)
2495
2496 c = a.sample(frac=0.5, random_state=1234)
2497 d = a.sample(frac=0.5, random_state=1234)
2498 assert_eq(c, d)
2499
2500 assert a.sample(frac=0.5)._name != a.sample(frac=0.5)._name
2501
2502
2503def test_sample_without_replacement():

Callers

nothing calls this directly

Calls 2

assert_eqFunction · 0.90
sampleMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…