parameters: (q: Union[float, Iterable[float]])
return_statement: return q_arr
docstring: Validate percentiles (used by describe and quantile).
  
      This function checks if the given float oriterable of floats is a valid percentile
      otherwise raises a ValueError.
  
      Parameters
      ----------
      q: float or iterable of floats
          A single percentile or an iterable of percentiles.
  
      Returns
      -------
      ndarray
          An ndarray of the percentiles if valid.
  
      Raises
      ------
      ValueError if percentiles are not in given interval([0, 1]).
docstring_summary: Validate percentiles (used by describe and quantile).
docstring_tokens: Validate percentiles ( used by describe and quantile ) .
function: def validate_percentile(q: Union[float, Iterable[float]]) -> np.ndarray:
      """
      Validate percentiles (used by describe and quantile).
  
      This function checks if the given float oriterable of floats is a valid percentile
      otherwise raises a ValueError.
  
      Parameters
      ----------
      q: float or iterable of floats
          A single percentile or an iterable of percentiles.
  
      Returns
      -------
      ndarray
          An ndarray of the percentiles if valid.
  
      Raises
      ------
      ValueError if percentiles are not in given interval([0, 1]).
      """
      msg = "percentiles should all be in the interval [0, 1]. Try {0} instead."
      q_arr = np.asarray(q)
      if q_arr.ndim == 0:
          if not 0 <= q_arr <= 1:
              raise ValueError(msg.format(q_arr / 100.0))
      else:
          if not all(0 <= qs <= 1 for qs in q_arr):
              raise ValueError(msg.format(q_arr / 100.0))
      return q_arr
function_tokens: def validate_percentile ( q : Union [ float , Iterable [ float ] ] ) -> np . ndarray : msg = "percentiles should all be in the interval [0, 1]. Try {0} instead." q_arr = np . asarray ( q ) if q_arr . ndim == 0 : if not 0 <= q_arr <= 1 : raise ValueError ( msg . format ( q_arr / 100.0 ) ) else : if not all ( 0 <= qs <= 1 for qs in q_arr ) : raise ValueError ( msg . format ( q_arr / 100.0 ) ) return q_arr