Update

class Update<T, C>(val df: DataFrame<T>, val filter: RowValueFilter<T, C>?, val columns: ColumnsSelector<T, C>)

The Update Operation

Returns the DataFrame with changed values in some cells (column types cannot be changed).

Check out: Grammar

For more information: See update on the documentation website.

Constructors

Link copied to clipboard
constructor(df: DataFrame<T>, filter: RowValueFilter<T, C>?, columns: ColumnsSelector<T, C>)

Types

Link copied to clipboard
internal typealias ColumnAccessorsParam = Nothing
Link copied to clipboard
internal typealias ColumnNamesParam = Nothing
Link copied to clipboard
interface Columns

The columns to update need to be selected. See Selecting Columns for all the selecting options.

Link copied to clipboard
internal typealias DslParam = Nothing
Link copied to clipboard
typealias Grammar = Nothing
Link copied to clipboard
internal typealias KPropertiesParam = Nothing
Link copied to clipboard

Selecting columns for various DataFrame operations can be done in the following ways:

Properties

Link copied to clipboard
internal val columns: ColumnsSelector<T, C>
Link copied to clipboard
internal val df: DataFrame<T>
Link copied to clipboard
internal val filter: RowValueFilter<T, C>?

Functions

Link copied to clipboard

Updates selected column group as a DataFrame with the given expression.

Link copied to clipboard
internal fun <T, C, R> Update<T, DataRow<C>>.asFrameImpl(expression: DataFrameExpression<C, DataFrame<R>>): DataFrame<T>

Implementation for Update As Frame: Replaces selected column groups with the result of the expression only where the filter is true.

Link copied to clipboard
fun <T, C> Update<T, C>.at(rowIndices: Collection<Int>): Update<T, C>
fun <T, C> Update<T, C>.at(rowRange: IntRange): Update<T, C>
fun <T, C> Update<T, C>.at(vararg rowIndices: Int): Update<T, C>

Only update the columns at certain given org.jetbrains.kotlinx.dataframe.api.CommonUpdateAtFunctionDoc.RowIndicesParam:

Link copied to clipboard
fun <R : C> cast(): Update<T, R>
Link copied to clipboard
fun <T, C> Update<T, C?>.notNull(): Update<T, C>

Filters the update-selection to only include cells where the value is not null.

fun <T, C> Update<T, C?>.notNull(expression: UpdateExpression<T, C, C>): DataFrame<T>

Selects only the rows where the values in the selected columns are not null.

Link copied to clipboard
fun <T, C> Update<T, C>.perCol(valueSelector: ColumnExpression<C, C>): DataFrame<T>
fun <T, C> Update<T, C>.perCol(values: Map<String, C>): DataFrame<T>
fun <T, C> Update<T, C>.perCol(values: DataRow<*>): DataFrame<T>

Per Col can be used for two different types of operations:

Link copied to clipboard
inline fun <T, C> Update<T, C>.perRowCol(crossinline expression: RowColumnExpression<T, C, C>): DataFrame<T>

Provide a new value for every selected cell given both its row and column using a row-column expression.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
internal fun <T, C> Update<T, C>.updateImpl(expression: (AddDataRow<T>, DataColumn<C>, C) -> C?): DataFrame<T>
Link copied to clipboard
Link copied to clipboard
fun <T, C> Update<T, C>.where(predicate: RowValueFilter<T, C>): Update<T, C>

Filter or find rows to operate on after selecting columns using a row value filter.

Link copied to clipboard
inline fun <T, C, R : C?> Update<T, C>.with(crossinline expression: UpdateExpression<T, C, R>): DataFrame<T>

Provide a new value for every selected cell given its row and its previous value using a row value expression.

Link copied to clipboard
fun <T, C> Update<T, C>.withNull(): DataFrame<T>

Specific version of with that simply sets the value of each selected row to null.

Link copied to clipboard
fun <T, C> Update<T, C>.withZero(): DataFrame<T>

Specific version of with that simply sets the value of each selected row to 0.