code: def rindex(f, ci, ch, cl, p=1):
      r"""Calculate the *range index* spanning a given period ``p``.
  
      The **range index** is a number between 0 and 100 that
      relates the value of the index column ``ci`` to the
      high column ``ch`` and the low column ``cl``. For example,
      if the low value of the range is 10 and the high value
      is 20, then the range index for a value of 15 would be 50%.
      The range index for 18 would be 80%.
  
      Parameters
      ----------
      f : pandas.DataFrame
          Dataframe containing the columns ``ci``, ``ch``, and ``cl``.
      ci : str
          Name of the index column in the dataframe ``f``.
      ch : str
          Name of the high column in the dataframe ``f``.
      cl : str
          Name of the low column in the dataframe ``f``.
      p : int
          The period over which the range index of column ``ci``
          is calculated.
  
      Returns
      -------
      new_column : pandas.Series (float)
          The array containing the new feature.
  
      """
      o = p - 1 if f[ci].name == "open" else 0
      hh = highest(f, ch, p)
      ll = lowest(f, cl, p)
      fn = f[ci].shift(o) - ll
      fd = hh - ll
      new_column = 100 * fn / fd
      return new_column
  
imports: from alphapy.calendrical import biz_day_month
  from alphapy.calendrical import biz_day_week
  from alphapy.globals import NULLTEXT
  from alphapy.globals import BSEP, PSEP, USEP
  from alphapy.variables import vexec
  import itertools
  import logging
  import math
  import numpy
  import pandas
label_desc: Use image node_id 37 for calling a global function with example usage: rindex(f, ci, ch, cl, p) and returns: new_column