def var(self, axis: Optional[Axis]=None, ddof: int=1, numeric_only: bool=None) -> Union[(Scalar, 'Series')]:
    "\n        Return unbiased variance.\n\n        Parameters\n        ----------\n        axis : {index (0), columns (1)}\n            Axis for the function to be applied on.\n        ddof : int, default 1\n            Delta Degrees of Freedom. The divisor used in calculations is N - ddof,\n            where N represents the number of elements.\n        numeric_only : bool, default None\n            Include only float, int, boolean columns. False is not supported. This parameter\n            is mainly for pandas compatibility.\n\n        Returns\n        -------\n        var : scalar for a Series, and a Series for a DataFrame.\n\n        Examples\n        --------\n\n        >>> df = ps.DataFrame({'a': [1, 2, 3, np.nan], 'b': [0.1, 0.2, 0.3, np.nan]},\n        ...                   columns=['a', 'b'])\n\n        On a DataFrame:\n\n        >>> df.var()\n        a    1.00\n        b    0.01\n        dtype: float64\n\n        >>> df.var(axis=1)\n        0    0.405\n        1    1.620\n        2    3.645\n        3      NaN\n        dtype: float64\n\n        >>> df.var(ddof=0)\n        a    0.666667\n        b    0.006667\n        dtype: float64\n\n        On a Series:\n\n        >>> df['a'].var()\n        1.0\n\n        >>> df['a'].var(ddof=0)\n        0.6666666666666666\n        "
    assert (ddof in (0, 1))
    axis = validate_axis(axis)
    if ((numeric_only is None) and (axis == 0)):
        numeric_only = True

    def var(spark_column: Column, spark_type: DataType) -> Column:
        if isinstance(spark_type, BooleanType):
            spark_column = spark_column.cast(LongType())
        elif (not isinstance(spark_type, NumericType)):
            raise TypeError('Could not convert {} ({}) to numeric'.format(spark_type_to_pandas_dtype(spark_type), spark_type.simpleString()))
        if (ddof == 0):
            return F.var_pop(spark_column)
        else:
            return F.var_samp(spark_column)
    return self._reduce_for_stat_function(var, name='var', axis=axis, numeric_only=numeric_only, ddof=ddof)
Return unbiased variance.

Parameters
----------
axis : {index (0), columns (1)}
    Axis for the function to be applied on.
ddof : int, default 1
    Delta Degrees of Freedom. The divisor used in calculations is N - ddof,
    where N represents the number of elements.
numeric_only : bool, default None
    Include only float, int, boolean columns. False is not supported. This parameter
    is mainly for pandas compatibility.

Returns
-------
var : scalar for a Series, and a Series for a DataFrame.

Examples
--------

>>> df = ps.DataFrame({'a': [1, 2, 3, np.nan], 'b': [0.1, 0.2, 0.3, np.nan]},
...                   columns=['a', 'b'])

On a DataFrame:

>>> df.var()
a    1.00
b    0.01
dtype: float64

>>> df.var(axis=1)
0    0.405
1    1.620
2    3.645
3      NaN
dtype: float64

>>> df.var(ddof=0)
a    0.666667
b    0.006667
dtype: float64

On a Series:

>>> df['a'].var()
1.0

>>> df['a'].var(ddof=0)
0.6666666666666666
def var(self, axis: Optional[Axis]=None, ddof: int=1, numeric_only: bool=None) -> Union[(Scalar, 'Series')]:
    "\n        Return unbiased variance.\n\n        Parameters\n        ----------\n        axis : {index (0), columns (1)}\n            Axis for the function to be applied on.\n        ddof : int, default 1\n            Delta Degrees of Freedom. The divisor used in calculations is N - ddof,\n            where N represents the number of elements.\n        numeric_only : bool, default None\n            Include only float, int, boolean columns. False is not supported. This parameter\n            is mainly for pandas compatibility.\n\n        Returns\n        -------\n        var : scalar for a Series, and a Series for a DataFrame.\n\n        Examples\n        --------\n\n        >>> df = ps.DataFrame({'a': [1, 2, 3, np.nan], 'b': [0.1, 0.2, 0.3, np.nan]},\n        ...                   columns=['a', 'b'])\n\n        On a DataFrame:\n\n        >>> df.var()\n        a    1.00\n        b    0.01\n        dtype: float64\n\n        >>> df.var(axis=1)\n        0    0.405\n        1    1.620\n        2    3.645\n        3      NaN\n        dtype: float64\n\n        >>> df.var(ddof=0)\n        a    0.666667\n        b    0.006667\n        dtype: float64\n\n        On a Series:\n\n        >>> df['a'].var()\n        1.0\n\n        >>> df['a'].var(ddof=0)\n        0.6666666666666666\n        "
    assert (ddof in (0, 1))
    axis = validate_axis(axis)
    if ((numeric_only is None) and (axis == 0)):
        numeric_only = True

    def var(spark_column: Column, spark_type: DataType) -> Column:
        if isinstance(spark_type, BooleanType):
            spark_column = spark_column.cast(LongType())
        elif (not isinstance(spark_type, NumericType)):
            raise TypeError('Could not convert {} ({}) to numeric'.format(spark_type_to_pandas_dtype(spark_type), spark_type.simpleString()))
        if (ddof == 0):
            return F.var_pop(spark_column)
        else:
            return F.var_samp(spark_column)
    return self._reduce_for_stat_function(var, name='var', axis=axis, numeric_only=numeric_only, ddof=ddof)