Code
pandas.DataFrame.fillna
For missing numerical values, a standard imputation heuristic is to substitute NaN entries with the mean of all available values in that column. In pandas, this is achieved by chaining the .fillna() and .mean() methods, such as inputs.fillna(inputs.mean()), which replaces all missing occurrences with the calculated column average.
0
1
Updated 2026-05-01
Tags
D2L
Dive into Deep Learning @ D2L