eland.DataFrame.var¶
-
DataFrame.
var
(numeric_only: Optional[bool] = None) → pandas.core.series.Series¶ Return variance for each numeric column
- Parameters
- numeric_only: {True, False, None} Default is None
Which datatype to be returned - True: Returns all values as float64, NaN/NaT values are removed - None: Returns all values as the same dtype where possible, NaN/NaT are removed - False: Returns all values as the same dtype where possible, NaN/NaT are preserved
- Returns
- pandas.Series
The value of the variance for each numeric column
See also
Examples
>>> df = ed.DataFrame('localhost', 'flights', columns=["AvgTicketPrice", "Cancelled", "dayOfWeek", "timestamp", "DestCountry"]) >>> df.var() # doctest: +SKIP AvgTicketPrice 70964.570234 Cancelled 0.111987 dayOfWeek 3.761279 dtype: float64
>>> df.var(numeric_only=True) AvgTicketPrice 70964.570234 Cancelled 0.111987 dayOfWeek 3.761279 dtype: float64
>>> df.var(numeric_only=False) # doctest: +SKIP AvgTicketPrice 70964.6 Cancelled 0.111987 dayOfWeek 3.76128 timestamp NaT DestCountry NaN dtype: object