code: def _ppf_np(spl, x, weights=None, assume_sorted=False):
      """Compute empirical ppf, fast numpy based subroutine.
  
      Parameters
      ----------
      spl : 1D np.ndarray
          empirical sample
      x : float
          probability at which to evaluate ppf
      weights : None or 1D np.ndarray, optional, default=None
          if None, computes unweighted ppf, if 1D np.ndarray, computes weighted ppf
          if not None, must be of same length as ``spl``, needs not be normalized
      assume_sorted : bool, optional, default=False
          if True, assumes that ``spl`` is sorted in ascending order
  
      Returns
      -------
      ppf_val float
          ppf-value at p
      """
      if weights is None:
          weights = np.ones(len(spl))
  
      if not assume_sorted:
          sorter = np.argsort(spl)
          spl = spl[sorter]
          weights = weights[sorter]
  
      w_sum = np.sum(weights)
      weights = weights / w_sum
  
      cum_weights = np.cumsum(weights)
      ix_val = np.searchsorted(cum_weights, x)
      ppf_val = spl[ix_val]
  
      return ppf_val
  
file_path: sktime/sktime/proba/empirical.py
imports: import numpy
  import pandas
  from sktime.proba.base import BaseDistribution
label_desc: Use image node_id 3 for calling a global function with example usage: _ppf_np(spl, x, weights, assume_sorted) and returns: ppf_val