rowStd
Returns the standard deviation of all the numbers in this DataRow, as a Double.
Only the values in the columns of a primitive number type (and in "mixed" Number columns) 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.
Since the values of different columns are combined, the result is the standard deviation of all those values converted to their common type.
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 the values of one specific number type in this row.rowStdOf<Type>()— the mean of all the numbers in this row.rowMean— 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 numbers ("age" and "weight") in the first row
// Columns of other types ("name" and "address") are ignored
df[0].rowStd()Return
The standard deviation of all the numbers 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).