def time_shift(x, shift):
    """Shift a series by a specified amount"""
    xshift = x.copy()
    if shift > 0:
        xshift[shift:] = x[0:-shift]
    elif shift < 0:
        xshift[0:shift] = x[-shift:]
    elif shift == 0:
        pass
    return xshift