@@ -3,6 +3,7 @@ package org.jetbrains.kotlinx.dataframe.api
33import org.jetbrains.kotlinx.dataframe.AnyRow
44import org.jetbrains.kotlinx.dataframe.ColumnExpression
55import org.jetbrains.kotlinx.dataframe.ColumnsSelector
6+ import org.jetbrains.kotlinx.dataframe.DataColumn
67import org.jetbrains.kotlinx.dataframe.DataFrame
78import org.jetbrains.kotlinx.dataframe.DataFrameExpression
89import org.jetbrains.kotlinx.dataframe.DataRow
@@ -11,6 +12,7 @@ import org.jetbrains.kotlinx.dataframe.RowValueFilter
1112import org.jetbrains.kotlinx.dataframe.annotations.AccessApiOverload
1213import org.jetbrains.kotlinx.dataframe.annotations.Interpretable
1314import org.jetbrains.kotlinx.dataframe.annotations.Refine
15+ import org.jetbrains.kotlinx.dataframe.api.mean
1416import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup
1517import org.jetbrains.kotlinx.dataframe.columns.ColumnReference
1618import org.jetbrains.kotlinx.dataframe.columns.toColumnSet
@@ -78,6 +80,9 @@ public class Update<T, C>(
7880 * `\[ `__`.`__[**`at`**][Update.at]**`(`**[`rowIndices`][CommonUpdateAtFunctionDoc.RowIndicesParam]**`)`**` ]`
7981 *
8082 * {@include [Indent]}
83+ * `\[ `__`.`__[**`notNull`**][Update.notNull]**`()`**` ]`
84+ *
85+ * {@include [Indent]}
8186 * __`.`__[**`with`**][Update.with]**` { `**[`rowExpression`][ExpressionsGivenRow.RowValueExpression.WithExample]**` }`**
8287 *
8388 * {@include [Indent]}
@@ -403,7 +408,21 @@ internal infix fun <T, C> RowValueFilter<T, C>?.and(other: RowValueFilter<T, C>)
403408 return { thisExp(this , it) && other(this , it) }
404409}
405410
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" )
407426@Interpretable(" UpdateNotNullDefault" )
408427public fun <T , C > Update <T , C ?>.notNull (): Update <T , C > = where { it != null } as Update <T , C >
409428
0 commit comments