code: def nanprod(
      values: np.ndarray,
      *,
      axis: AxisInt | None = None,
      skipna: bool = True,
      min_count: int = 0,
      mask: npt.NDArray[np.bool_] | None = None,
  ) -> float:
      """
      Parameters
      ----------
      values : ndarray[dtype]
      axis : int, optional
      skipna : bool, default True
      min_count: int, default 0
      mask : ndarray[bool], optional
          nan-mask if known
  
      Returns
      -------
      Dtype
          The product of all elements on a given axis. ( NaNs are treated as 1)
  
      Examples
      --------
      >>> from pandas.core import nanops
      >>> s = pd.Series([1, 2, 3, np.nan])
      >>> nanops.nanprod(s.values)
      6.0
      """
      mask = _maybe_get_mask(values, skipna, mask)
  
      if skipna and mask is not None:
          values = values.copy()
          values[mask] = 1
      result = values.prod(axis)
      # error: Incompatible return value type (got "Union[ndarray, float]", expected
      # "float")
      return _maybe_null_out(  # type: ignore[return-value]
          result, axis, mask, values.shape, min_count=min_count
      )
  
imports: from __future__ import annotations
  import functools
  import itertools
  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_complex, is_float, is_float_dtype, is_integer, is_numeric_dtype, is_object_dtype, needs_i8_conversion, pandas_dtype
  from pandas.core.dtypes.missing import isna, na_value_for_dtype, notna
label_desc: Use image node_id 29 for calling a global function with example usage: nanprod(values) and returns: _maybe_null_out