()
| 2332 | |
| 2333 | |
| 2334 | def 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 | |
| 2358 | def test_fillna(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…