[//]: # (title: update) Returns [`DataFrame`](DataFrame.md) with changed values in some cells. Column types can not be changed. ```text update { columns } [.where { rowCondition } ] [.at(rowIndices) ] .with { rowExpression } | .notNull { rowExpression } | .perCol { colExpression } | .perRowCol { rowColExpression } | .withNull() | .withZero() | .asFrame { frameExpression } rowCondition: DataRow.(OldValue) -> Boolean rowExpression: DataRow.(OldValue) -> NewValue colExpression: DataColumn.(DataColumn) -> NewValue rowColExpression: (DataRow, DataColumn) -> NewValue frameExpression: DataFrame.(DataFrame) -> DataFrame ``` **Related operations**: [](updateConvert.md) See [column selectors](ColumnSelectors.md) for how to select the columns for this operation and [row expressions](DataRow.md#row-expressions) for how to specify the new values. ```kotlin df.update { age }.with { it * 2 } df.update { colsAtAnyDepth().colsOf() }.with { it.uppercase() } df.update { weight }.at(1..4).notNull { it / 2 } df.update { name.lastName and age }.at(1, 3, 4).withNull() ``` Update with constant value: ```kotlin df.update { city }.where { name.firstName == "Alice" }.with { "Paris" } ``` Update with value depending on row: ```kotlin df.update { city }.with { name.firstName + " from " + it } ``` Update with value depending on column: ```kotlin df.update { colsOf() }.perCol { mean(skipNaN = true) } ``` Update with value depending on row and column: ```kotlin df.update { colsOf() }.perRowCol { row, col -> col.name() + ": " + row.index() } ``` Update [ColumnGroup](DataColumn.md#columngroup) as [DataFrame](DataFrame.md): ```kotlin df.update { name }.asFrame { select { lastName } } ```