def _idx_from_dates(d1, d2, freq):
    from pandas import DatetimeIndex
    return len(DatetimeIndex(start=d1, end=d2,
                             freq = _freq_to_pandas[freq])) - 1
Returns an index offset from datetimes d1 and d2. d1 is expected to be the
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/tsa/base/datetools.py/_idx_from_dates