class_docstr: Benchmark for np.unique with np.nan values.
class_docstr_tok: ["Benchmark","for","np.unique","with","np.nan","values","."]
code: def setup(self, array_size, percent_nans):
      np.random.seed(123)
      # produce a randomly shuffled array with the
      # approximate desired percentage np.nan content
      base_array = np.random.uniform(size=array_size)
      n_nan = int(percent_nans * array_size)
      nan_indices = np.random.choice(np.arange(array_size), size=n_nan)
      base_array[nan_indices] = np.nan
      self.arr = base_array
  
imports: from .common import Benchmark
  import numpy
label_desc: Use image node_id 1 for calling the Unique obj's underlying member method code with example usage: obj.setup(array_size, percent_nans) without return types