We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 77982bf commit 914364fCopy full SHA for 914364f
lectures/polars.md
@@ -443,13 +443,13 @@ Polars also provides us with convenient methods to replace missing values.
443
444
For example, we can use forward fill, backward fill, or interpolation
445
446
+Here we fill `null` values with the column means
447
+
448
```{code-cell} ipython3
-# Fill with column means for numeric columns
449
cols = ["cc", "tcgdp", "POP", "XRAT"]
450
df_with_nulls.with_columns([
- pl.col(cols).fill_null(pl.col(cols).mean()) # fill null values with the column mean
451
+ pl.col(cols).fill_null(pl.col(cols).mean())
452
])
-```
453
454
Missing value imputation is a big area in data science involving various machine learning techniques.
455
0 commit comments