class_docstr: Preallocation strategies for rolling window over expanding data set
  
  Restrictions: major_axis can only be a DatetimeIndex for now
class_docstr_tok: ["Preallocation","strategies","for","rolling","window","over","expanding","data","set","Restrictions",":","major_axis","can","only","be","a","DatetimeIndex","for","now"]
code: 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()
  
imports: import datetime
  from copy import deepcopy
  import numpy
  import pandas
label_desc: Use image node_id 1 to create a new RollingPanel object from inherited base classes: object with example: obj = RollingPanel(window, items, sids, cap_multiple, dtype, initial_dates)