@disallow('<STR_LIT>')<EOL>@bottleneck_switch(ddof=<NUM_LIT:1>)<EOL>def nanvar(values, axis=None, skipna=True, ddof=<NUM_LIT:1>, mask=None):
values = com.values_from_object(values)<EOL>dtype = values.dtype<EOL>if mask is None:<EOL><INDENT>mask = isna(values)<EOL><DEDENT>if is_any_int_dtype(values):<EOL><INDENT>values = values.astype('<STR_LIT>')<EOL>values[mask] = np.nan<EOL><DEDENT>if is_float_dtype(values):<EOL><INDENT>count, d = _get_counts_nanvar(mask, axis, ddof, values.dtype)<EOL><DEDENT>else:<EOL><INDENT>count, d = _get_counts_nanvar(mask, axis, ddof)<EOL><DEDENT>if skipna:<EOL><INDENT>values = values.copy()<EOL>np.putmask(values, mask, <NUM_LIT:0>)<EOL><DEDENT>avg = _ensure_numeric(values.sum(axis=axis, dtype=np.float64)) / count<EOL>if axis is not None:<EOL><INDENT>avg = np.expand_dims(avg, axis)<EOL><DEDENT>sqr = _ensure_numeric((avg - values) ** <NUM_LIT:2>)<EOL>np.putmask(sqr, mask, <NUM_LIT:0>)<EOL>result = sqr.sum(axis=axis, dtype=np.float64) / d<EOL>if is_float_dtype(dtype):<EOL><INDENT>result = result.astype(dtype)<EOL><DEDENT>return _wrap_results(result, values.dtype)<EOL>
Compute the variance along given axis while ignoring NaNs

Parameters
----------
values : ndarray
axis: int, optional
skipna : bool, default True
ddof : int, default 1
    Delta Degrees of Freedom. The divisor used in calculations is N - ddof,
    where N represents the number of elements.
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, np.nan, 2, 3])
>>> nanops.nanvar(s)
1.0