rowStdOf
Returns the standard deviation of the values of type T in this DataRow, as a Double.
Only the values in the columns of type T (or its nullable variant) are taken into account; all other columns of the row are ignored.
Columns inside column groups are also excluded. To include those in the standard deviation, flatten the DataFrame first.
T must be a primitive number type or Number itself.
All primitive number types are supported: Byte, Short, Int, Long, Float, and Double. "Mixed" Number input is supported too, as long as it consists solely of those primitive numbers; its values are then first converted to their common type using UnifiedNumberTypeOptions.PRIMITIVES_ONLY, see number unification. Big numbers (, BigInteger) are not supported; BigDecimal them to a primitive number type first.convert
null values in the input are always ignored.
If the input contains values, the result will be NaNNaN, unless skipNaN is set to true.
The resulting standard deviation is always a Double and never null. Converting Long values to Double may lose precision for very large values.
For more information about the resulting types: See "std Type Conversion" on the documentation website.
When there is nothing to compute the standard deviation of, for instance, when the input is empty or contains only null values, the result is Double.NaN. The same holds when there are no more than ddof values, so, by default, for a single value.
See also:
— the standard deviation of all the numbers in this row, of any number type.rowStd— the standard deviation of the values in specific columns of astdDataFrame.The Std Operation— an overview of allstdmodes.
For more information: See "Row statistics" on the documentation website.
Example
// The standard deviation of all `Int` values ("age" and "weight") in the first row
df[0].rowStdOf<Int>()
// The population standard deviation of all `Double` values in the first row, ignoring `NaN` values
df[0].rowStdOf<Double>(skipNaN = true, ddof = 0)Return
The standard deviation of the values of type T in this row, as a Double.
Parameters
"Delta Degrees of Freedom". The divisor used in the calculation is N - ddof, where N is the number of values. The default is 1, which applies Bessel's correction and computes the unbiased sample standard deviation (as in R). Use 0 for the population standard deviation (as in Numpy).
Type Parameters
The type of the values to include. Only columns of this type are taken into account.