def shift_series(s):
    s0 = s.copy()
    s0 = s0.shift(1)
    s0.iloc[0] = 0.0
    return s0
Produces a copy of the provided series shifted by one, starting with 0.
dataset/ETHPy150Open bokeh/bokeh/bokeh/charts/utils.py/shift_series