code: def _get_p(df, column, shifts):
          
          column_name = '{}_{}_p'.format(column, shifts)
          # initialize the column if not
          df.get(column)
          shifts = StockDataFrame.to_ints(shifts)[::-1]
          indices = None
          count = 0
          for shift in shifts:
              shifted = df.shift(-shift)
              index = (shifted[column] > 0) * (2 ** count)
              if indices is None:
                  indices = index
              else:
                  indices += index
              count += 1
          StockDataFrame.set_nan(indices, shifts)
          df[column_name] = indices
docs: get the permutation of specified range
  
          example:
          index    x   x_-2,-1_p
          0        1         NaN
          1       -1         NaN
          2        3           2  (0.x > 0, and assigned to weight 2)
          3        5           1  (2.x > 0, and assigned to weight 1)
          4        1           3
  
          :param df: data frame
          :param column: the column to calculate p from
          :param shifts: the range to consider
          :return: