def pushZeroTime(ts, deep = False, invert = True):
    """
    Make the time series start or end at zero

    Arguments:
        ts {Dataframe / Time Series} -- The time series to invert
        invert {bool} --  Invert the time axis, ie the last point of the time series become zero
                        And all points before are positive times
                        Otherwise start at 0

    Returns:
        The inverted time series
    """
    res = ts.copy(deep)
    if invert:
        res.index =  ts.index.max() - ts.index
    else:
        res.index =  ts.index - ts.index.min() 
    return res.sort_index()