

def test_pct_change_shift_over_nas(self):
    s = Series([1.0, 1.5, np.nan, 2.5, 3.0])
    chg = s.pct_change()
    expected = Series([np.nan, 0.5, np.nan, ((2.5 / 1.5) - 1), 0.2])
    assert_series_equal(chg, expected)

dataset/ETHPy150Open pydata/pandas/pandas/tests/series/test_timeseries.py TestSeriesTimeSeries.test_pct_change_shift_over_nas/original