@@ -3,6 +3,7 @@ package org.jetbrains.kotlinx.dataframe.api
3
3
import org.jetbrains.kotlinx.dataframe.AnyRow
4
4
import org.jetbrains.kotlinx.dataframe.ColumnExpression
5
5
import org.jetbrains.kotlinx.dataframe.ColumnsSelector
6
+ import org.jetbrains.kotlinx.dataframe.DataColumn
6
7
import org.jetbrains.kotlinx.dataframe.DataFrame
7
8
import org.jetbrains.kotlinx.dataframe.DataFrameExpression
8
9
import org.jetbrains.kotlinx.dataframe.DataRow
@@ -11,6 +12,7 @@ import org.jetbrains.kotlinx.dataframe.RowValueFilter
11
12
import org.jetbrains.kotlinx.dataframe.annotations.AccessApiOverload
12
13
import org.jetbrains.kotlinx.dataframe.annotations.Interpretable
13
14
import org.jetbrains.kotlinx.dataframe.annotations.Refine
15
+ import org.jetbrains.kotlinx.dataframe.api.mean
14
16
import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup
15
17
import org.jetbrains.kotlinx.dataframe.columns.ColumnReference
16
18
import org.jetbrains.kotlinx.dataframe.columns.toColumnSet
@@ -78,6 +80,9 @@ public class Update<T, C>(
78
80
* `\[ `__`.`__[**`at`**][Update.at]**`(`**[`rowIndices`][CommonUpdateAtFunctionDoc.RowIndicesParam]**`)`**` ]`
79
81
*
80
82
* {@include [Indent]}
83
+ * `\[ `__`.`__[**`notNull`**][Update.notNull]**`()`**` ]`
84
+ *
85
+ * {@include [Indent]}
81
86
* __`.`__[**`with`**][Update.with]**` { `**[`rowExpression`][ExpressionsGivenRow.RowValueExpression.WithExample]**` }`**
82
87
*
83
88
* {@include [Indent]}
@@ -403,7 +408,21 @@ internal infix fun <T, C> RowValueFilter<T, C>?.and(other: RowValueFilter<T, C>)
403
408
return { thisExp(this , it) && other(this , it) }
404
409
}
405
410
406
- /* * @include [Update.notNull] */
411
+ /* *
412
+ * ## Not Null
413
+ * Filters the update-selection to only include cells where the value is not null.
414
+ *
415
+ * This is shorthand for `.`[where][Update.where]` { it != null }`.
416
+ *
417
+ * For example:
418
+ *
419
+ * `df.`[update][update]` { `[colsOf][colsOf]`<`[Int][Int]`?>() }.`[notNull][notNull]`().`[perRowCol][Update.perRowCol]` { row, col ->`
420
+ *
421
+ * {@include [Indent]}`row\[col\] / col.`[mean][DataColumn.mean]`(skipNA = true)`
422
+ *
423
+ * `}`
424
+ */
425
+ @Suppress(" UNCHECKED_CAST" )
407
426
@Interpretable(" UpdateNotNullDefault" )
408
427
public fun <T , C > Update <T , C ?>.notNull (): Update <T , C > = where { it != null } as Update <T , C >
409
428
0 commit comments