rowSumOf
Returns the sum of the Short values in this DataRow, as an Int.
Only the values in the columns of type Short (or Short?) are taken into account; all other columns of the row are ignored.
Columns inside column groups are also excluded. To include those in the sum, flatten the DataFrame first.
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.
The result is never null and has the same type as the input, except for Byte and Short, which sum to Int, and "mixed" Number input, which sums to the common type of its values.
For more information about the resulting types: See "sum Type Conversion" on the documentation website.
When there is nothing to sum, for instance, when the input is empty or contains only null values, the result is 0 in the result type
See also:
— the sum of all the numbers in this row, of any number type.rowSum— the sum of the values in specific columns of asumDataFrame.The Sum Operation— an overview of allsummodes.
For more information: See "Row statistics" on the documentation website.
Example
// The sum of all `Short` values in the first row, as an `Int`
df[0].rowSumOf<Short>()Return
Parameters
Technical parameter to distinguish this overload from the others; you never need to supply it.
Type Parameters
The type of the values to sum. Only columns of this type are taken into account.
Returns the sum of the Byte values in this DataRow, as an Int.
Only the values in the columns of type Byte (or Byte?) are taken into account; all other columns of the row are ignored.
Columns inside column groups are also excluded. To include those in the sum, flatten the DataFrame first.
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.
The result is never null and has the same type as the input, except for Byte and Short, which sum to Int, and "mixed" Number input, which sums to the common type of its values.
For more information about the resulting types: See "sum Type Conversion" on the documentation website.
When there is nothing to sum, for instance, when the input is empty or contains only null values, the result is 0 in the result type
See also:
— the sum of all the numbers in this row, of any number type.rowSum— the sum of the values in specific columns of asumDataFrame.The Sum Operation— an overview of allsummodes.
For more information: See "Row statistics" on the documentation website.
Example
// The sum of all `Byte` values in the first row, as an `Int`
df[0].rowSumOf<Byte>()Return
Parameters
Technical parameter to distinguish this overload from the others; you never need to supply it.
Type Parameters
The type of the values to sum. Only columns of this type are taken into account.
Returns the sum of the Int values in this DataRow.
Only the values in the columns of type Int (or Int?) are taken into account; all other columns of the row are ignored.
Columns inside column groups are also excluded. To include those in the sum, flatten the DataFrame first.
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.
The result is never null and has the same type as the input, except for Byte and Short, which sum to Int, and "mixed" Number input, which sums to the common type of its values.
For more information about the resulting types: See "sum Type Conversion" on the documentation website.
When there is nothing to sum, for instance, when the input is empty or contains only null values, the result is 0 in the result type
See also:
— the sum of all the numbers in this row, of any number type.rowSum— the sum of the values in specific columns of asumDataFrame.The Sum Operation— an overview of allsummodes.
For more information: See "Row statistics" on the documentation website.
Example
// The sum of all `Int` values ("age" and "weight") in the first row
df[0].rowSumOf<Int>()Return
The sum of the Int values in this row.
Parameters
Technical parameter to distinguish this overload from the others; you never need to supply it.
Type Parameters
The type of the values to sum. Only columns of this type are taken into account.
Returns the sum of the Long values in this DataRow.
Only the values in the columns of type Long (or Long?) are taken into account; all other columns of the row are ignored.
Columns inside column groups are also excluded. To include those in the sum, flatten the DataFrame first.
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.
The result is never null and has the same type as the input, except for Byte and Short, which sum to Int, and "mixed" Number input, which sums to the common type of its values.
For more information about the resulting types: See "sum Type Conversion" on the documentation website.
When there is nothing to sum, for instance, when the input is empty or contains only null values, the result is 0 in the result type
See also:
— the sum of all the numbers in this row, of any number type.rowSum— the sum of the values in specific columns of asumDataFrame.The Sum Operation— an overview of allsummodes.
For more information: See "Row statistics" on the documentation website.
Example
// The sum of all `Long` values in the first row
df[0].rowSumOf<Long>()Return
The sum of the Long values in this row.
Parameters
Technical parameter to distinguish this overload from the others; you never need to supply it.
Type Parameters
The type of the values to sum. Only columns of this type are taken into account.
Returns the sum of the Float values in this DataRow.
Only the values in the columns of type Float (or Float?) are taken into account; all other columns of the row are ignored.
Columns inside column groups are also excluded. To include those in the sum, flatten the DataFrame first.
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 result is never null and has the same type as the input, except for Byte and Short, which sum to Int, and "mixed" Number input, which sums to the common type of its values.
For more information about the resulting types: See "sum Type Conversion" on the documentation website.
When there is nothing to sum, for instance, when the input is empty or contains only null values, the result is 0 in the result type
See also:
— the sum of all the numbers in this row, of any number type.rowSum— the sum of the values in specific columns of asumDataFrame.The Sum Operation— an overview of allsummodes.
For more information: See "Row statistics" on the documentation website.
Example
// The sum of all `Float` values in the first row, ignoring `NaN` values
df[0].rowSumOf<Float>(skipNaN = true)Return
The sum of the Float values in this row.
Parameters
Technical parameter to distinguish this overload from the others; you never need to supply it.
Type Parameters
The type of the values to sum. Only columns of this type are taken into account.
Returns the sum of the Double values in this DataRow.
Only the values in the columns of type Double (or Double?) are taken into account; all other columns of the row are ignored.
Columns inside column groups are also excluded. To include those in the sum, flatten the DataFrame first.
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 result is never null and has the same type as the input, except for Byte and Short, which sum to Int, and "mixed" Number input, which sums to the common type of its values.
For more information about the resulting types: See "sum Type Conversion" on the documentation website.
When there is nothing to sum, for instance, when the input is empty or contains only null values, the result is 0 in the result type
See also:
— the sum of all the numbers in this row, of any number type.rowSum— the sum of the values in specific columns of asumDataFrame.The Sum Operation— an overview of allsummodes.
For more information: See "Row statistics" on the documentation website.
Example
// The sum of all `Double` values in the first row, ignoring `NaN` values
df[0].rowSumOf<Double>(skipNaN = true)Return
The sum of the Double values in this row.
Parameters
Technical parameter to distinguish this overload from the others; you never need to supply it.
Type Parameters
The type of the values to sum. Only columns of this type are taken into account.
Returns the sum of the values of the given type in this DataRow.
Only the values in the columns of the given type (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 sum, flatten the DataFrame first.
This overload takes the type as a KType argument; prefer the reified overloads, like rowSumOf<Int>(), whenever the type is known at compile time.
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 result is never null and has the same type as the input, except for Byte and Short, which sum to Int, and "mixed" Number input, which sums to the common type of its values.
For more information about the resulting types: See "sum Type Conversion" on the documentation website.
When there is nothing to sum, for instance, when the input is empty or contains only null values, the result is 0 in the result type
See also:
— the sum of all the numbers in this row, of any number type.rowSum— the sum of the values in specific columns of asumDataFrame.The Sum Operation— an overview of allsummodes.
For more information: See "Row statistics" on the documentation website.
Example
// The sum of all `Int` values ("age" and "weight") in the first row
df[0].rowSumOf(typeOf<Int>())Return
The sum of the values of the given type in this row.
Parameters
The type of the values to sum. Only columns of this type are taken into account.