nan as the missing marker
What it is
NumPy has no separate missing value: nan is a float, so only float arrays can carry missingness. Integer and boolean arrays cannot, and casting a column with holes to int destroys them.
Why it matters
It sets the dtype of every feature matrix that has gaps, and it explains why a missing count has to be stored as a float or paired with a mask.
In the real world: Marking missing sensor readings as nan so they can be found and filled before the data goes to a predictive-maintenance model.
X = np.array([[1.0, np.nan], [3.0, 4.0]])
np.isnan(X) # the mask, same shape
np.isnan(X).sum(axis=0) # missing per column: array([0, 1])
np.isnan(X).any(axis=1) # which rows are incomplete
X[np.isnan(X)] = 0.0 # fill in place, if that is the rule you wantUsing a sentinel like -1 or -999 instead. Every reduction then includes it silently — the mean of a column with a thousand -999s is not a mean of anything — and no isnan check will ever find it.