Primary
numpy.nan ⚬|Documentation|1st|20251021151459-00-⌔
Constants — NumPy v2 Manual#numpy.nan
numpy.nanIEEE 754 floating point representation of Not a Number (NaN).
Returns:
y: A floating point representation of Not a Number.
See Also:
isnan: Shows which elements are Not a Number.
isfinite: Shows which elements are finite (not one of Not a Number, positive infinity and negative infinity)
Notes:
NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic (IEEE 754). This means that Not a Number is not equivalent to infinity.
Examples:
>>> import numpy as np >>> np.nan nan >>> np.log(-1) np.float64(nan) >>> np.log([-1, 1, 2]) array([ nan, 0. , 0.69314718])Printed 2026-06-28.
(echo:: @ ᯤ)
Link to original
Secondary
• • •