MCPcopy
hub / github.com/pandas-dev/pandas / test_ewma_nan_handling_cases

Function test_ewma_nan_handling_cases

pandas/tests/window/test_ewm.py:415–425  ·  view source on GitHub ↗
(s, adjust, ignore_na, w)

Source from the content-addressed store, hash-verified

413 ],
414)
415def test_ewma_nan_handling_cases(s, adjust, ignore_na, w):
416 # GH 7603
417 s = Series(s)
418 expected = (s.multiply(w).cumsum() / Series(w).cumsum()).ffill()
419 result = s.ewm(com=2.0, adjust=adjust, ignore_na=ignore_na).mean()
420
421 tm.assert_series_equal(result, expected)
422 if ignore_na is False:
423 # check that ignore_na defaults to False
424 result = s.ewm(com=2.0, adjust=adjust).mean()
425 tm.assert_series_equal(result, expected)
426
427
428def test_ewm_alpha():

Callers

nothing calls this directly

Calls 5

SeriesClass · 0.90
ffillMethod · 0.45
cumsumMethod · 0.45
meanMethod · 0.45
ewmMethod · 0.45

Tested by

no test coverage detected