code: def _shift(arr, num, fill_value=np.nan):
      # this function is adapted from
      # https://stackoverflow.com/questions/30399534/shift-elements-in-a-numpy-array
      result = np.empty_like(arr)
      if num > 0:
          result[:num] = fill_value
          result[num:] = arr[:-num]
      elif num < 0:
          result[num:] = fill_value
          result[:num] = arr[-num:]
      else:
          result[:] = arr
      return result
  
file_path: analytics-zoo/pyzoo/zoo/chronos/data/utils/roll.py
imports: import numpy
  import pandas
label_desc: Use image node_id 5 for calling a global function with example usage: _shift(arr, num, fill_value) and returns: result