'ignore nan' in numpy functions
The "normal" functions like np.mean and np.std evalutates the NaN i.e the result you've provided evaluates to NaN.
If you want to avoid that, use np.nanmean and np.nanstd. Note that since you have only one non-nan element the std is 0, thus you are dividing by zero.
The elementary functions in numpy, like mean() and std() returns np.nan when encounter np.nan. Can I make them ignore it?