

def _idx_from_dates(d1, d2, freq):
    '\n    Returns an index offset from datetimes d1 and d2. d1 is expected to be the\n    last date in a date series and d2 is the out of sample date.\n\n    Notes\n    -----\n    Rounds down the index if the end date is before the next date at freq.\n    Does not check the start date to see whether it is on the offest but\n    assumes that it is.\n    '
    from pandas import DatetimeIndex
    return (len(DatetimeIndex(start=d1, end=d2, freq=_freq_to_pandas[freq])) - 1)

dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/tsa/base/datetools.py _idx_from_dates/original