MCPcopy
hub / github.com/dask/dask / test_embarrassingly_parallel_operations

Function test_embarrassingly_parallel_operations

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

Source from the content-addressed store, hash-verified

2332
2333
2334def test_embarrassingly_parallel_operations():
2335 df = pd.DataFrame(
2336 {"x": [1, 2, 3, 4, None, 6], "y": list("abdabd")},
2337 index=[10, 20, 30, 40, 50, 60],
2338 )
2339 a = dd.from_pandas(df, 2)
2340
2341 assert_eq(a.x.astype("float32"), df.x.astype("float32"))
2342 assert a.x.astype("float32").compute().dtype == "float32"
2343
2344 assert_eq(a.x.dropna(), df.x.dropna())
2345
2346 assert_eq(a.x.between(2, 4), df.x.between(2, 4))
2347
2348 assert_eq(a.x.clip(2, 4), df.x.clip(2, 4))
2349
2350 assert_eq(a.x.notnull(), df.x.notnull())
2351 assert_eq(a.x.isnull(), df.x.isnull())
2352 assert_eq(a.notnull(), df.notnull())
2353 assert_eq(a.isnull(), df.isnull())
2354
2355 assert len(a.sample(frac=0.5).compute()) < len(df)
2356
2357
2358def test_fillna():

Callers

nothing calls this directly

Calls 9

assert_eqFunction · 0.90
betweenMethod · 0.80
notnullMethod · 0.80
sampleMethod · 0.80
astypeMethod · 0.45
computeMethod · 0.45
dropnaMethod · 0.45
clipMethod · 0.45
isnullMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…