Dataframe
 
1.0

convert

Edit pageLast modified: 24 July 2025

Returns DataFrame with changed values in some columns. Allows changing column types.

Related operations: Update / convert values

See column selectors for how to select the columns for this operation and row expressions for how to provide new values.

ColumnGroup can be converted using DataFrame API, for example:

Similar to replace with operation, columns can be converted in a compiler plugin-friendly fashion whenever you need to perform an operation on the entire column without changing its name. For example, parallel reading.

convert supports automatic type conversions between the following types:

  • String (uses parse to convert from String to other types)

  • Boolean

  • Byte

  • Short

  • Int (and Char)

  • Long

  • Float

  • Double (See parsing doubles for String to Double conversion)

  • BigDecimal

  • BigInteger

  • LocalDateTime (kotlinx.datetime and java.time)

  • LocalDate (kotlinx.datetime and java.time)

  • LocalTime (kotlinx.datetime and java.time)

  • Instant (kotlinx.datetime and java.time)

Automatic conversion from String to enum classes is also supported:

And finally, Value classes can be used with convert too. Both as conversion source and target: