Learn Before
Code

pandas.DataFrame.mean()

The mean() method in pandas.DataFrame calculates the mathematical average of the values along a specified axis. When applied to a dataset containing missing values (NaN), it computes the mean of the available numerical entries in each column by default. This method is frequently used to programmatically determine the substitution values required for numerical imputation.

# Calculate the mean of each column column_means = inputs.mean()

0

1

Updated 2026-05-01

Contributors are:

Who are from:

Tags

D2L

Dive into Deep Learning @ D2L