@disallow('<STR_LIT>', DatetimeTZDtype)<EOL>@bottleneck_switch()<EOL>def nanmean(values, axis=None, skipna=True, mask=None):
values, mask, dtype, dtype_max, _ = _get_values(<EOL>values, skipna, <NUM_LIT:0>, mask=mask)<EOL>dtype_sum = dtype_max<EOL>dtype_count = np.float64<EOL>if (is_integer_dtype(dtype) or is_timedelta64_dtype(dtype) or<EOL>is_datetime64_dtype(dtype) or is_datetime64tz_dtype(dtype)):<EOL><INDENT>dtype_sum = np.float64<EOL><DEDENT>elif is_float_dtype(dtype):<EOL><INDENT>dtype_sum = dtype<EOL>dtype_count = dtype<EOL><DEDENT>count = _get_counts(mask, axis, dtype=dtype_count)<EOL>the_sum = _ensure_numeric(values.sum(axis, dtype=dtype_sum))<EOL>if axis is not None and getattr(the_sum, '<STR_LIT>', False):<EOL><INDENT>with np.errstate(all="<STR_LIT:ignore>"):<EOL><INDENT>the_mean = the_sum / count<EOL><DEDENT>ct_mask = count == <NUM_LIT:0><EOL>if ct_mask.any():<EOL><INDENT>the_mean[ct_mask] = np.nan<EOL><DEDENT><DEDENT>else:<EOL><INDENT>the_mean = the_sum / count if count > <NUM_LIT:0> else np.nan<EOL><DEDENT>return _wrap_results(the_mean, dtype)<EOL>
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
-------
result : float
    Unless input is a float array, in which case use the same
    precision as the input array.

Examples
--------
>>> import pandas.core.nanops as nanops
>>> s = pd.Series([1, 2, np.nan])
>>> nanops.nanmean(s)
1.5