code: def nanpercentile(
      a,
      /,
      *,
      q,
      axis=None,
      out=None,
      overwrite_input=False,
      method="linear",
      keepdims=False,
      interpolation=None,
  ):
      a = ivy.array(a)
      q = ivy.divide(q, 100.0)
      q = ivy.array(q)
  
      if not _quantile_is_valid(q):
          # raise ValueError("percentile s must be in the range [0, 100]")
          ivy.logging.warning(
              "percentile s must be in the range [0, 100]"
          )
          return []
  
      if axis is None:
          resultarray = []
          nanlessarray = []
          for x in a:
              for i in x:
                  if not ivy.isnan(i):
                      nanlessarray.append(i)
  
          for i in q:
              resultarray.append(_cpercentile(nanlessarray, i))
          return resultarray
      elif axis == 1:
          resultarray = []
          nanlessarrayofarrays = []
          for i in a:
              nanlessarray = []
              for t in i:
                  if not ivy.isnan(t):
                      nanlessarray.append(t)
              nanlessarrayofarrays.append(nanlessarray)
          for i in q:
              arrayofpercentiles = []
              for ii in nanlessarrayofarrays:
                  arrayofpercentiles.append(_cpercentile(ii, i))
              resultarray.append(arrayofpercentiles)
          return resultarray
      elif axis == 0:
          resultarray = []
  
          try:
              a = ivy.swapaxes(a, 0, 1)
          except ivy.utils.exceptions.IvyError:
              ivy.logging.warning("axis is 0 but couldn't swap")
  
          finally:
              nanlessarrayofarrays = []
              for i in a:
                  nanlessarray = []
                  for t in i:
                      if not ivy.isnan(t):
                          nanlessarray.append(t)
                  nanlessarrayofarrays.append(nanlessarray)
              for i in q:
                  arrayofpercentiles = []
                  for ii in nanlessarrayofarrays:
                      arrayofpercentiles.append(_cpercentile(ii, i))
                  resultarray.append(arrayofpercentiles)
          return resultarray
  
imports: import ivy
  from ivy.functional.frontends.numpy.func_wrapper import to_ivy_arrays_and_back, handle_numpy_out
label_desc: Use image node_id 3 for calling a global function with example usage: nanpercentile() and returns: list, resultarray, resultarray, resultarray