code: def _fill_missing_values(
      f: np.ndarray, is_categorical: bool
  ) -> np.ndarray:
      """Fills `f` with `np.nan` for missing values.
  
      Missing values are represented with `np.nan`, regardless of the dtype of the
      returned np.ndarray. All continuous features (i.e. is_categorical == False)
      are cast to float.
  
      E.g.
        np.array([1, 2, None]) -> np.array([1.0, 2.0, nan], dtype=float)
        np.array(['a', None, None]) -> np.array(['a', nan, nan], dtype=object)
  
      Args:
        f: np.ndarray.
        is_categorical: bool.
  
      Returns:
        np.ndarray.
      """
      if is_categorical:
          f = f.astype(object)
          f[pd.isnull(f)] = np.nan
          return f
      else:
          # Converting to np.float64 is necessary for getting smaller errors.
          return f.astype(float)
  
imports: import functools
  import itertools
  import math
  from typing import Any, List, Optional, Tuple, Union
  import uuid
  import numpy
  import pandas
  import scipy.special
  import sklearn.neighbors
label_desc: Use image node_id 12 for calling a global function with example usage: _fill_missing_values(f, is_categorical) and returns: f, f