code: def roll(df, window, shift: int = 1):
      """Implementation of rolling window that can handle non-numerical columns such as histograms
  
      :param pd.DataFrame df: input dataframe to apply rolling function to.
      :param int window: size of rolling window
      :param int shift: shift of dataframe, default is 1 (optional)
      """
      assert shift >= 0
      assert isinstance(
          df, (pd.DataFrame, pd.Series)
      ), "input should be a dataframe or series"
  
      cols = df.columns if isinstance(df, pd.DataFrame) else [df.name]
      x = df.values
      # apply shift
      x = x[:-shift] if shift > 0 else x
  
      # apply windowing, use numpy's as_strided function to step through x and create sub-arrays
      if isinstance(df, pd.DataFrame):
          d0, d1 = x.shape
          s0, s1 = x.strides
          arr = as_strided(
              x, (d0 - (window - 1), window, d1), (s0, s0, s1)
          )
      elif isinstance(df, pd.Series):
          hopsize = 1
          nrows = ((x.size - window) // hopsize) + 1
          if nrows < 0:
              nrows = 0
          n = x.strides[0]
          arr = as_strided(
              x, shape=(nrows, window), strides=(hopsize * n, n)
          )
  
      # fill up missing values b/c off window & shift with Nones
      arr_shape = list(arr.shape)
      arr_shape[0] = len(df.index) - len(arr)
      arr_shape = tuple(arr_shape)
      n_fill = len(cols) * window * (len(df.index) - len(arr))
      fill_value = np.array([[None] * n_fill]).reshape(arr_shape)
      arr = np.append(fill_value, arr, axis=0)
  
      # reshape to new data frame
      def reshape(vs, i):
          return vs if len(vs.shape) == 1 else vs[:, i]
  
      d = [
          {c: reshape(vals, i) for i, c in enumerate(cols)}
          for vals in arr
      ]
      rolled_df = pd.DataFrame(data=d, index=df.index)
  
      return rolled_df
  
imports: import numpy
  import pandas
  from numpy.lib.stride_tricks import as_strided
  from scipy import linalg, stats
  from scipy.stats import linregress, norm
  from popmon.analysis.hist_numpy import check_similar_hists, get_consistent_numpy_2dgrids, get_consistent_numpy_entries, set_2dgrid
  from popmon.hist.hist_utils import COMMON_HIST_TYPES, is_numeric
  from popmon.stats.numpy import probability_distribution_mean_covariance
label_desc: Use image node_id 10 for calling a global function with example usage: roll(df, window, shift) and returns: rolled_df, unknown