DataFrame.var(axis=_NoDefault.no_default, skipna=True, ddof=1, numeric_only=False, **kwargs)[source]#

Return unbiased variance of the DataFrame.

Normalized by N-1 by default. This can be changed using the ddof argument.

axis: {index (0), columns(1)}

Axis for the function to be applied on.

skipna: bool, default True

Exclude NA/null values. If an entire row/column is NA, the result will be NA.

ddof: int, default 1

Delta Degrees of Freedom. The divisor used in calculations is N - ddof, where N represents the number of elements.

numeric_onlybool, default False

If True, includes only float, int, boolean columns. If False, will raise error in-case there are non-numeric columns.



>>> import cudf
>>> df = cudf.DataFrame({'a': [1, 2, 3, 4], 'b': [7, 8, 9, 10]})
>>> df.var()
a    1.666667
b    1.666667
dtype: float64

Pandas Compatibility Note

pandas.DataFrame.var(), pandas.Series.var()

Parameters currently not supported are level and numeric_only