

def __init__(self, window, items, sids, cap_multiple=2, dtype=np.float64, initial_dates=None):
    self._pos = window
    self._window = window
    self.items = _ensure_index(items)
    self.minor_axis = _ensure_index(sids)
    self.cap_multiple = cap_multiple
    self.dtype = dtype
    if (initial_dates is None):
        self.date_buf = (np.empty(self.cap, dtype='M8[ns]') * pd.NaT)
    elif (len(initial_dates) != window):
        raise ValueError('initial_dates must be of length window')
    else:
        self.date_buf = np.hstack((initial_dates, np.empty((window * (cap_multiple - 1)), dtype='datetime64[ns]')))
    self.buffer = self._create_buffer()

dataset/ETHPy150Open quantopian/zipline/zipline/utils/data.py RollingPanel.__init__/original