code: def nanmean(
      values: np.ndarray,
      *,
      axis: AxisInt | None = None,
      skipna: bool = True,
      mask: npt.NDArray[np.bool_] | None = None,
  ) -> float:
      """
      Compute the mean of the element along an axis ignoring NaNs
  
      Parameters
      ----------
      values : ndarray
      axis : int, optional
      skipna : bool, default True
      mask : ndarray[bool], optional
          nan-mask if known
  
      Returns
      -------
      float
          Unless input is a float array, in which case use the same
          precision as the input array.
  
      Examples
      --------
      >>> from pandas.core import nanops
      >>> s = pd.Series([1, 2, np.nan])
      >>> nanops.nanmean(s)
      1.5
      """
      values, mask, dtype, dtype_max, _ = _get_values(
          values, skipna, fill_value=0, mask=mask
      )
      dtype_sum = dtype_max
      dtype_count = np.dtype(np.float64)
  
      # not using needs_i8_conversion because that includes period
      if dtype.kind in ["m", "M"]:
          dtype_sum = np.dtype(np.float64)
      elif is_integer_dtype(dtype):
          dtype_sum = np.dtype(np.float64)
      elif is_float_dtype(dtype):
          dtype_sum = dtype
          dtype_count = dtype
  
      count = _get_counts(values.shape, mask, axis, dtype=dtype_count)
      the_sum = _ensure_numeric(values.sum(axis, dtype=dtype_sum))
  
      if axis is not None and getattr(the_sum, "ndim", False):
          count = cast(np.ndarray, count)
          with np.errstate(all="ignore"):
              # suppress division by zero warnings
              the_mean = the_sum / count
          ct_mask = count == 0
          if ct_mask.any():
              the_mean[ct_mask] = np.nan
      else:
          the_mean = the_sum / count if count > 0 else np.nan
  
      return the_mean
  
imports: from __future__ import annotations
  import functools
  import itertools
  import operator
  from typing import Any, Callable, cast
  import warnings
  import numpy
  from pandas._config import get_option
  from pandas._libs import NaT, NaTType, iNaT, lib
  from pandas._typing import ArrayLike, AxisInt, CorrelationMethod, Dtype, DtypeObj, F, Scalar, Shape, npt
  from pandas.compat._optional import import_optional_dependency
  from pandas.util._exceptions import find_stack_level
  from pandas.core.dtypes.common import is_any_int_dtype, is_bool_dtype, is_complex, is_datetime64_any_dtype, is_float, is_float_dtype, is_integer, is_integer_dtype, is_numeric_dtype, is_object_dtype, is_scalar, is_timedelta64_dtype, needs_i8_conversion, pandas_dtype
  from pandas.core.dtypes.dtypes import PeriodDtype
  from pandas.core.dtypes.missing import isna, na_value_for_dtype, notna
  from pandas.core.construction import extract_array
label_desc: Use image node_id 16 for calling a global function with example usage: nanmean(values) and returns: the_mean