# fill

> For the complete documentation index, see [llms.txt](https://kotlin.github.io/dataframe/llms.txt).

Replace missing values.

API reference: [fill](https://kotlin.github.io/dataframe/api-docs/core/org.jetbrains.kotlinx.dataframe.api/fill.html)

Related operations: [Update / convert values](updateconvert.html)

The examples on this page use the following dataframe:

```KOTLIN
df
```

[Embedded content](./resources/fillDf.html)

## fillNulls

Replaces `null` values with the given value or expression.

See also [dropNulls](drop.html#dropnulls), which removes rows with `null` values instead of replacing these values.

See [column selectors](columnselectors.html) for how to select the columns for this operation.

```KOTLIN
df.fillNulls { weight }.with { -1.0 }
```

[Embedded content](./resources/fillNulls.html)

same as

```KOTLIN
df.update { weight }.where { it == null }.with { -1.0 }
```

[Embedded content](./resources/fillNulls.html)

## fillNaNs

Replaces [NaN values](nanandna.html#nan) (`Double.NaN` and `Float.NaN`) with the given value or expression.

See also [dropNaNs](drop.html#dropnans), which removes rows with [NaN values](nanandna.html#nan) instead of replacing these values.

See [column selectors](columnselectors.html) for how to select the columns for this operation.

```KOTLIN
df.fillNaNs { weight }.withZero()
```

[Embedded content](./resources/fillNaNs.html)

## fillNA

Replaces [NA values](nanandna.html#na) (`null`, `Double.NaN`, and `Float.NaN`) with the given value or expression.

See also [dropNA](drop.html#dropna), which removes rows with [NA values](nanandna.html#na) instead of replacing these values.

See [column selectors](columnselectors.html) for how to select the columns for this operation.

```KOTLIN
df.fillNA { weight }.with { -1.0 }
```

[Embedded content](./resources/fillNA.html)

