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

Function test_ffill

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

Source from the content-addressed store, hash-verified

2370
2371
2372def test_ffill():
2373 df = _compat.makeMissingDataFrame()
2374 ddf = dd.from_pandas(df, npartitions=5, sort=False)
2375
2376 assert_eq(ddf.ffill(), df.ffill())
2377 assert_eq(ddf.A.ffill(), df.A.ffill())
2378 assert_eq(ddf.ffill(limit=2), df.ffill(limit=2))
2379 assert_eq(ddf.A.ffill(limit=2), df.A.ffill(limit=2))
2380 assert_eq(ddf.ffill(axis=1), df.ffill(axis=1))
2381 assert_eq(ddf.ffill(limit=2, axis=1), df.ffill(limit=2, axis=1))
2382
2383 df = _compat.makeMissingDataFrame()
2384 df.iloc[:15, 0] = np.nan # all NaN partition
2385 ddf = dd.from_pandas(df, npartitions=5, sort=False)
2386 pytest.raises(ValueError, lambda: ddf.ffill().compute())
2387 assert_eq(df.ffill(limit=3), ddf.ffill(limit=3))
2388
2389
2390def test_bfill():

Callers

nothing calls this directly

Calls 3

assert_eqFunction · 0.90
ffillMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected