code: def unique_counts(
      x: np.ndarray,
      /,
  ) -> Tuple[np.ndarray, np.ndarray]:
      v, c = np.unique(x, return_counts=True)
      nan_count = np.count_nonzero(np.isnan(x))
      if nan_count > 1:
          nan_idx = np.where(np.isnan(v))
          c[nan_idx] = 1
          v = np.append(v, np.full(nan_count - 1, np.nan)).astype(
              x.dtype
          )
          c = np.append(c, np.full(nan_count - 1, 1)).astype("int32")
      Results = namedtuple("Results", ["values", "counts"])
      return Results(v, c)
  
file_path: ivy/ivy/functional/backends/numpy/set.py
imports: import numpy
  from typing import Tuple, Optional
  from collections import namedtuple
  from packaging import version
  import ivy
label_desc: Use image node_id 2 for calling a global function with example usage: unique_counts() and returns: Results