DataFrame.std

DataFrame.std(numeric_only: bool | None = None) Series

Return standard deviation 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 standard deviation for each numeric column

See Also

:pandas_api_docs:`pandas.DataFrame.std`

Examples

>>> from tests import OPENSEARCH_TEST_CLIENT
>>> df = oml.DataFrame(OPENSEARCH_TEST_CLIENT, 'flights', columns=["AvgTicketPrice", "Cancelled", "dayOfWeek", "timestamp", "DestCountry"])
>>> df.std()  
AvgTicketPrice    266.407061
Cancelled           0.334664
dayOfWeek           1.939513
dtype: float64
>>> df.std(numeric_only=True)
AvgTicketPrice    266.407061
Cancelled           0.334664
dayOfWeek           1.939513
dtype: float64
>>> df.std(numeric_only=False)  
AvgTicketPrice     266.407
Cancelled         0.334664
dayOfWeek          1.93951
timestamp              NaT
DestCountry            NaN
dtype: object