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

Function test_embarrassingly_parallel_operations

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

Source from the content-addressed store, hash-verified

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