Skip to content
masterclass Buddy

NumPy · Function

np.nanmean

Computes arithmetic means while ignoring NaN values. It reduces the whole input by default or works along selected axes.

Last updated

Since
1.22.0 for the where parameter

Syntax

numpy.nanmean(a, axis=None, dtype=None, out=None, keepdims=<no value>, *, where=<no value>)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • numpy.mean
  • numpy.average
  • numpy.std
  • numpy.var
  • numpy.nanstd
  • numpy.nanvar

Source: numpy.nanmean — NumPy v2.5 Manual. Checked 2026-11-03.