Dataframe 0.14 Help

NaN and NA

Using the Kotlin DataFrame library, you might come across the terms NaN and NA. This page explains what they mean and how to work with them.

NaN

Float or Double values can be represented as NaN, in cases where a mathematical operation is undefined, such as for dividing by zero. The result of such an operation can only be described as " Not a Number".

This is different from null, which means that a value is missing and, in Kotlin, can only occur for Float? and Double? types.

You can use fillNaNs to replace NaNs in certain columns with a given value or expression or dropNaNs to drop rows with NaNs in them.

NA

NA in Dataframe can be seen as: NaN or null. Which is another way to say that the value is " Not Available".

You can use fillNA to replace NAs in certain columns with a given value or expression or dropNA to drop rows with NAs in them.

Last modified: 27 September 2024