mean

fun DataColumn<Number?>.mean(skipNaN: Boolean = skipNaNDefault): Double

Returns the mean of the values in this DataColumn, as a Double.

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, BigDecimal) are not supported; convert them to a primitive number type first.

null values in the input are always ignored.

If the input contains NaN values, the result will be NaN, unless skipNaN is set to true.

The resulting average 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 "mean Type Conversion" on the documentation website.

When there is nothing to average, for instance, when the input is empty or contains only null values, the result is Double.NaN.

See also:

  • meanOf — the mean of the values an expression returns for each element.

  • sum — the sum of the values in this column.

  • The Mean Operation — an overview of all mean modes.

For more information: See mean on the documentation website.

Example

// The mean of all ages in the "age" Int column
df.age.mean()
// The mean of all weights in the "weight" `Double?` column, ignoring `null` values
df.weight.mean()

Return

The mean of the values in this column, as a Double.

Parameters

skipNaN

If true, NaN values are ignored, just like null values. If false (the default), a NaN in the input is propagated to the result. This only has an effect on Double and Float values.


fun <T> DataFrame<T>.mean(skipNaN: Boolean = skipNaNDefault): DataRow<T>

Returns the mean of the values of each suitable column of this DataFrame separately.

All columns of a primitive number type (and all "mixed" Number columns) are taken into account; the other columns are simply left out of the result.

Columns inside column groups are also excluded. To include those in the mean, 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, BigDecimal) are not supported; convert them to a primitive number type first.

null values in the input are always ignored.

If the input contains NaN values, the result will be NaN, unless skipNaN is set to true.

The resulting average 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 "mean Type Conversion" on the documentation website.

Result cells for which there is nothing to average (for instance, because the input was empty or contained only null values) simply become Double.NaN.

See also:

  • meanFor{ columns } — the same, but for an explicit selection of columns.

  • mean{ columns } — a single mean of means of the selected columns.

  • sum() — the sum of each column separately.

  • The Mean Operation — an overview of all mean modes.

For more information: See mean on the documentation website.

Example

// A single row with the mean of each number column ("age" and "weight")
df.mean()

Return

A single DataRow with the mean of each suitable column of this DataFrame.

Parameters

skipNaN

If true, NaN values are ignored, just like null values. If false (the default), a NaN in the input is propagated to the result. This only has an effect on Double and Float values.


fun <T, C : Number?> DataFrame<T>.mean(skipNaN: Boolean = skipNaNDefault, columns: ColumnsSelector<T, C>): Double

Returns a single mean of means of the selected columns of this DataFrame, as a Double.

When multiple columns are selected, the result is a mean of means: first, the mean of each selected column is computed separately, and then the mean of those per-column means is taken. This differs from the mean of all values pooled together whenever the selected columns contain a different number of values to average. For instance, for age = [20, 25] and weight = [65, null], the result is (22.5 + 65) / 2 = 43.75.

A selected column with nothing to average has Double.NaN as its mean, which makes the whole result Double.NaN, unless skipNaN is true.

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, BigDecimal) are not supported; convert them to a primitive number type first.

null values in the input are always ignored.

If the input contains NaN values, the result will be NaN, unless skipNaN is set to true.

The resulting average 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 "mean Type Conversion" on the documentation website.

When there is nothing to average, for instance, when the input is empty or contains only null values, the result is Double.NaN.

This can include column groups and nested columns.

See also:

  • meanFor — the mean of each selected column separately.

  • meanOf — the mean of the values a row expression returns for each row.

  • sum — the sum of all values in the selected columns.

  • The Mean Operation — an overview of all mean modes.

For more information: See mean on the documentation website.

Select or express columns using the Columns Selection DSL.

This DSL is initiated by a Columns Selector lambda, which operates in the context of the Columns Selection DSL and expects you to return a SingleColumn or ColumnSet (so, a ColumnsResolver). This is an entity formed by calling any (combination) of the functions in the DSL that is or can be resolved into one or more columns.

The Columns Selection DSL allows using Extension Properties for specifying columns type- and name-safe.

Check out: Columns Selection DSL Grammar

    

See Column Selectors on the documentation website.

Example

// The mean of the mean of "age" and the mean of "weight"
df.mean { age and weight }

Return

The mean of the per-column means of the selected columns, as a Double.

Parameters

skipNaN

If true, NaN values are ignored, just like null values. If false (the default), a NaN in the input is propagated to the result. This only has an effect on Double and Float values.

columns

The ColumnsSelector used to select the columns to compute the mean of.


fun <T> DataFrame<T>.mean(vararg columns: String, skipNaN: Boolean = skipNaNDefault): Double

Returns a single mean of means of the selected columns of this DataFrame, as a Double.

When multiple columns are selected, the result is a mean of means: first, the mean of each selected column is computed separately, and then the mean of those per-column means is taken. This differs from the mean of all values pooled together whenever the selected columns contain a different number of values to average. For instance, for age = [20, 25] and weight = [65, null], the result is (22.5 + 65) / 2 = 43.75.

A selected column with nothing to average has Double.NaN as its mean, which makes the whole result Double.NaN, unless skipNaN is true.

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, BigDecimal) are not supported; convert them to a primitive number type first.

null values in the input are always ignored.

If the input contains NaN values, the result will be NaN, unless skipNaN is set to true.

The resulting average 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 "mean Type Conversion" on the documentation website.

When there is nothing to average, for instance, when the input is empty or contains only null values, the result is Double.NaN.

This can include column groups and nested columns.

See also:

  • meanFor — the mean of each selected column separately.

  • meanOf — the mean of the values a row expression returns for each row.

  • sum — the sum of all values in the selected columns.

  • The Mean Operation — an overview of all mean modes.

For more information: See mean on the documentation website.

Select single or multiple columns using their names as Strings. (String API).

Example

// The mean of the mean of "age" and the mean of "weight"
df.mean("age", "weight")

Return

The mean of the per-column means of the selected columns, as a Double.

Parameters

columns

The names of the columns to compute the mean of. These must be existing columns holding only primitive numbers, else an IllegalStateException or IllegalArgumentException is thrown.

skipNaN

If true, NaN values are ignored, just like null values. If false (the default), a NaN in the input is propagated to the result. This only has an effect on Double and Float values.


fun <T> Grouped<T>.mean(skipNaN: Boolean = skipNaNDefault): DataFrame<T>

Aggregates this GroupBy by computing the mean of the values of each suitable column separately, per group.

Returns a new DataFrame with one row per group, containing the group key columns and a column with the mean for each suitable column.

All columns of a primitive number type (and all "mixed" Number columns) are taken into account; the other columns are simply left out of the result.

Columns inside column groups are also excluded. To include those in the mean, 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, BigDecimal) are not supported; convert them to a primitive number type first.

null values in the input are always ignored.

If the input contains NaN values, the result will be NaN, unless skipNaN is set to true.

The resulting average 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 "mean Type Conversion" on the documentation website.

Result cells for which there is nothing to average (for instance, because the input was empty or contained only null values) simply become Double.NaN.

See also:

  • meanFor — the same, but for an explicit selection of columns.

  • mean{ columns } — a single mean of means of the selected columns, per group.

  • sum — the sum of each column, per group.

  • aggregate — the general way to aggregate groups.

  • The Mean Operation — an overview of all mean modes.

For more information: See "groupBy statistics" on the documentation website., and See "GroupBy Aggregation Statistics" on the documentation website.

Example

// For each city, the mean of each number column ("age" and "weight")
df.groupBy { city }.mean()

Return

A new DataFrame with the group keys and the mean of each suitable column per group.

Parameters

skipNaN

If true, NaN values are ignored, just like null values. If false (the default), a NaN in the input is propagated to the result. This only has an effect on Double and Float values.


fun <T, C : Number?> Grouped<T>.mean(name: String? = null, skipNaN: Boolean = skipNaNDefault, columns: ColumnsSelector<T, C>): DataFrame<T>

Aggregates this GroupBy by computing a single mean of means of the selected columns, per group.

Returns a new DataFrame with one row per group, containing the group key columns and a single column with the mean per group. That column is named name, or, if name is null, after the selected column if exactly one column is selected, and "mean" otherwise.

When multiple columns are selected, the result is a mean of means: first, the mean of each selected column is computed separately, and then the mean of those per-column means is taken. This differs from the mean of all values pooled together whenever the selected columns contain a different number of values to average. For instance, for age = [20, 25] and weight = [65, null], the result is (22.5 + 65) / 2 = 43.75.

A selected column with nothing to average has Double.NaN as its mean, which makes the whole result Double.NaN, unless skipNaN is true.

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, BigDecimal) are not supported; convert them to a primitive number type first.

null values in the input are always ignored.

If the input contains NaN values, the result will be NaN, unless skipNaN is set to true.

The resulting average 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 "mean Type Conversion" on the documentation website.

Result cells for which there is nothing to average (for instance, because the input was empty or contained only null values) simply become Double.NaN.

This can include column groups and nested columns.

See Selecting Columns.

See also:

  • meanFor — the mean of each selected column separately, per group.

  • meanOf — the mean of the values a row expression returns for each row of a group.

  • aggregate — the general way to aggregate groups.

  • The Mean Operation — an overview of all mean modes.

For more information: See "groupBy statistics" on the documentation website., and See "GroupBy Aggregation Statistics" on the documentation website.

Example

// For each city, the mean of the mean of "age" and the mean of "weight",
// in a column called "average"
df.groupBy { city }.mean("average") { age and weight }

Return

A new DataFrame with the group keys and a single mean per group.

Parameters

name

The name of the resulting column. If null (the default), the name of the selected column is used if exactly one column is selected, and "mean" otherwise. This name needs to be unique, else a DuplicateColumnPathInsertException is thrown.

skipNaN

If true, NaN values are ignored, just like null values. If false (the default), a NaN in the input is propagated to the result. This only has an effect on Double and Float values.

columns

The ColumnsSelector used to select the columns to compute the mean of.


fun <T> Grouped<T>.mean(vararg columns: String, name: String? = null, skipNaN: Boolean = skipNaNDefault): DataFrame<T>

Aggregates this GroupBy by computing a single mean of means of the selected columns, per group.

Returns a new DataFrame with one row per group, containing the group key columns and a single column with the mean per group. That column is named name, or, if name is null, after the selected column if exactly one column is selected, and "mean" otherwise.

When multiple columns are selected, the result is a mean of means: first, the mean of each selected column is computed separately, and then the mean of those per-column means is taken. This differs from the mean of all values pooled together whenever the selected columns contain a different number of values to average. For instance, for age = [20, 25] and weight = [65, null], the result is (22.5 + 65) / 2 = 43.75.

A selected column with nothing to average has Double.NaN as its mean, which makes the whole result Double.NaN, unless skipNaN is true.

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, BigDecimal) are not supported; convert them to a primitive number type first.

null values in the input are always ignored.

If the input contains NaN values, the result will be NaN, unless skipNaN is set to true.

The resulting average 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 "mean Type Conversion" on the documentation website.

Result cells for which there is nothing to average (for instance, because the input was empty or contained only null values) simply become Double.NaN.

This can include column groups and nested columns.

See Selecting Columns.

See also:

  • meanFor — the mean of each selected column separately, per group.

  • meanOf — the mean of the values a row expression returns for each row of a group.

  • aggregate — the general way to aggregate groups.

  • The Mean Operation — an overview of all mean modes.

For more information: See "groupBy statistics" on the documentation website., and See "GroupBy Aggregation Statistics" on the documentation website.

Example

// For each city, the mean of the mean of "age" and the mean of "weight",
// in a column called "average"
df.groupBy { city }.mean("age", "weight", name = "average")

Return

A new DataFrame with the group keys and a single mean per group.

Parameters

columns

The names of the columns to compute the mean of. These must be existing columns holding only primitive numbers, else an IllegalStateException or IllegalArgumentException is thrown.

name

The name of the resulting column. If null (the default), the name of the selected column is used if exactly one column is selected, and "mean" otherwise. This name needs to be unique, else a DuplicateColumnPathInsertException is thrown.

skipNaN

If true, NaN values are ignored, just like null values. If false (the default), a NaN in the input is propagated to the result. This only has an effect on Double and Float values.


fun <T> Pivot<T>.mean(skipNaN: Boolean = skipNaNDefault, separate: Boolean = false): DataRow<T>

Aggregates this Pivot by computing the mean of the values of each suitable column separately, per group.

Returns a single DataRow with the pivot keys as (nested) columns, containing the mean of each suitable column of the corresponding group.

All columns of a primitive number type (and all "mixed" Number columns) are taken into account; the other columns are simply left out of the result.

Columns inside column groups are also excluded. To include those in the mean, 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, BigDecimal) are not supported; convert them to a primitive number type first.

null values in the input are always ignored.

If the input contains NaN values, the result will be NaN, unless skipNaN is set to true.

The resulting average 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 "mean Type Conversion" on the documentation website.

Result cells for which there is nothing to average (for instance, because the input was empty or contained only null values) simply become Double.NaN.

Check out the Pivot Grammar.

See also:

For more information: See "pivot statistics" on the documentation website., and See "Pivot Aggregation statistics" on the documentation website.

Example

// For each city, the mean of each number column ("age" and "weight")
df.pivot { city }.mean()

Return

A single DataRow with the mean of each suitable column per pivot group.

Parameters

skipNaN

If true, NaN values are ignored, just like null values. If false (the default), a NaN in the input is propagated to the result. This only has an effect on Double and Float values.

separate

If false (the default), the resulting columns are indexed first by the pivot key(s) and then by the names of the aggregated columns. If true, this order is reversed: the results are grouped by aggregated column first.


fun <T, R : Number?> Pivot<T>.mean(skipNaN: Boolean = skipNaNDefault, columns: ColumnsSelector<T, R>): DataRow<T>

Aggregates this Pivot by computing a single mean of means of the selected columns, per group.

Returns a single DataRow with the pivot keys as (nested) columns, containing the mean of means of the selected columns of the corresponding group.

When multiple columns are selected, the result is a mean of means: first, the mean of each selected column is computed separately, and then the mean of those per-column means is taken. This differs from the mean of all values pooled together whenever the selected columns contain a different number of values to average. For instance, for age = [20, 25] and weight = [65, null], the result is (22.5 + 65) / 2 = 43.75.

A selected column with nothing to average has Double.NaN as its mean, which makes the whole result Double.NaN, unless skipNaN is true.

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, BigDecimal) are not supported; convert them to a primitive number type first.

null values in the input are always ignored.

If the input contains NaN values, the result will be NaN, unless skipNaN is set to true.

The resulting average 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 "mean Type Conversion" on the documentation website.

Result cells for which there is nothing to average (for instance, because the input was empty or contained only null values) simply become Double.NaN.

This can include column groups and nested columns.

See Selecting Columns, or check out the Pivot Grammar.

See also:

For more information: See "pivot statistics" on the documentation website., and See "Pivot Aggregation statistics" on the documentation website.

Example

// For each city, the mean of the mean of "age" and the mean of "weight"
df.pivot { city }.mean { age and weight }

Return

A DataRow with, per pivot group, a single mean of means of the selected columns.

Parameters

skipNaN

If true, NaN values are ignored, just like null values. If false (the default), a NaN in the input is propagated to the result. This only has an effect on Double and Float values.

columns

The ColumnsSelector used to select the columns to compute the mean of.


fun <T> PivotGroupBy<T>.mean(separate: Boolean = false, skipNaN: Boolean = skipNaNDefault): DataFrame<T>

Aggregates this PivotGroupBy by computing the mean of the values of each suitable column separately, per group.

Returns a DataFrame where each cell contains the mean of each suitable column of the group corresponding to that pivot key (column) and groupBy key (row).

All columns of a primitive number type (and all "mixed" Number columns) are taken into account; the other columns are simply left out of the result.

Columns inside column groups are also excluded. To include those in the mean, 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, BigDecimal) are not supported; convert them to a primitive number type first.

null values in the input are always ignored.

If the input contains NaN values, the result will be NaN, unless skipNaN is set to true.

The resulting average 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 "mean Type Conversion" on the documentation website.

Result cells for which there exists a group, but there is nothing to average (for instance, because the group was empty or contained only null values) simply become Double.NaN.

For empty pivot intersections, null or the set default is used.

Check out the PivotGroupBy Grammar.

See also:

For more information: See "pivot statistics" on the documentation website., and See "Pivot Aggregation statistics" on the documentation website.

Example

// Per city and last name, the mean of each number column ("age" and "weight")
df.pivot { city }.groupBy { name.lastName }.mean()

Return

A DataFrame with the mean of each suitable column per group.

Parameters

separate

If false (the default), the resulting columns are indexed first by the pivot key(s) and then by the names of the aggregated columns. If true, this order is reversed: the results are grouped by aggregated column first.

skipNaN

If true, NaN values are ignored, just like null values. If false (the default), a NaN in the input is propagated to the result. This only has an effect on Double and Float values.


fun <T, R : Number?> PivotGroupBy<T>.mean(skipNaN: Boolean = skipNaNDefault, columns: ColumnsSelector<T, R>): DataFrame<T>

Aggregates this PivotGroupBy by computing a single mean of means of the selected columns, per group.

Returns a DataFrame where each cell contains the mean of means of the selected columns of the group corresponding to that pivot key (column) and groupBy key (row).

When multiple columns are selected, the result is a mean of means: first, the mean of each selected column is computed separately, and then the mean of those per-column means is taken. This differs from the mean of all values pooled together whenever the selected columns contain a different number of values to average. For instance, for age = [20, 25] and weight = [65, null], the result is (22.5 + 65) / 2 = 43.75.

A selected column with nothing to average has Double.NaN as its mean, which makes the whole result Double.NaN, unless skipNaN is true.

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, BigDecimal) are not supported; convert them to a primitive number type first.

null values in the input are always ignored.

If the input contains NaN values, the result will be NaN, unless skipNaN is set to true.

The resulting average 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 "mean Type Conversion" on the documentation website.

Result cells for which there exists a group, but there is nothing to average (for instance, because the group was empty or contained only null values) simply become Double.NaN.

For empty pivot intersections, null or the set default is used.

This can include column groups and nested columns.

See Selecting Columns, or check out the PivotGroupBy Grammar.

See also:

For more information: See "pivot statistics" on the documentation website., and See "Pivot Aggregation statistics" on the documentation website.

Example

// Per city and last name, the mean of the mean of "age" and the mean of "weight"
df.pivot { city }.groupBy { name.lastName }.mean { age and weight }

Return

A DataFrame with, per group, a single mean of means of the selected columns.

Parameters

skipNaN

If true, NaN values are ignored, just like null values. If false (the default), a NaN in the input is propagated to the result. This only has an effect on Double and Float values.

columns

The ColumnsSelector used to select the columns to compute the mean of.


fun <T> PivotGroupBy<T>.mean(vararg columns: String, skipNaN: Boolean = skipNaNDefault): DataFrame<T>

Aggregates this PivotGroupBy by computing a single mean of means of the selected columns, per group.

Returns a DataFrame where each cell contains the mean of means of the selected columns of the group corresponding to that pivot key (column) and groupBy key (row).

When multiple columns are selected, the result is a mean of means: first, the mean of each selected column is computed separately, and then the mean of those per-column means is taken. This differs from the mean of all values pooled together whenever the selected columns contain a different number of values to average. For instance, for age = [20, 25] and weight = [65, null], the result is (22.5 + 65) / 2 = 43.75.

A selected column with nothing to average has Double.NaN as its mean, which makes the whole result Double.NaN, unless skipNaN is true.

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, BigDecimal) are not supported; convert them to a primitive number type first.

null values in the input are always ignored.

If the input contains NaN values, the result will be NaN, unless skipNaN is set to true.

The resulting average 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 "mean Type Conversion" on the documentation website.

Result cells for which there exists a group, but there is nothing to average (for instance, because the group was empty or contained only null values) simply become Double.NaN.

For empty pivot intersections, null or the set default is used.

This can include column groups and nested columns.

See Selecting Columns, or check out the PivotGroupBy Grammar.

See also:

For more information: See "pivot statistics" on the documentation website., and See "Pivot Aggregation statistics" on the documentation website.

Example

// Per city and last name, the mean of the mean of "age" and the mean of "weight"
df.pivot { city }.groupBy { name.lastName }.mean("age", "weight")

Return

A DataFrame with, per group, a single mean of means of the selected columns.

Parameters

columns

The names of the columns to compute the mean of. These must be existing columns holding only primitive numbers, else an IllegalStateException or IllegalArgumentException is thrown.

skipNaN

If true, NaN values are ignored, just like null values. If false (the default), a NaN in the input is propagated to the result. This only has an effect on Double and Float values.


@get:JvmName(name = "ColumnDescription_mean")
val ColumnsScope<ColumnDescription>.mean: DataColumn<Double>
@get:JvmName(name = "ColumnDescription_mean")
val DataRow<ColumnDescription>.mean: Double
@get:JvmName(name = "NullableColumnDescription_mean")
val ColumnsScope<ColumnDescription?>.mean: DataColumn<Double?>
@get:JvmName(name = "NullableColumnDescription_mean")
val DataRow<ColumnDescription?>.mean: Double?


fun <T, C : Number?> DataFrame<T>.mean(vararg columns: ColumnReference<C>, skipNaN: Boolean = skipNaNDefault): Double
fun <T, C : Number?> DataFrame<T>.mean(vararg columns: KProperty<C>, skipNaN: Boolean = skipNaNDefault): Double
fun <T, C : Number?> Grouped<T>.mean(vararg columns: ColumnReference<C>, name: String? = null, skipNaN: Boolean = skipNaNDefault): DataFrame<T>
fun <T, C : Number?> Grouped<T>.mean(vararg columns: KProperty<C>, name: String? = null, skipNaN: Boolean = skipNaNDefault): DataFrame<T>
fun <T, R : Number?> PivotGroupBy<T>.mean(vararg columns: ColumnReference<R>, skipNaN: Boolean = skipNaNDefault): DataFrame<T>
fun <T, R : Number?> PivotGroupBy<T>.mean(vararg columns: KProperty<R>, skipNaN: Boolean = skipNaNDefault): DataFrame<T>

Deprecated

It's recommended to migrate to the String or Extension Properties Access API https://kotlin.github.io/dataframe/apilevels.html