I have a pandas dataframe with a column of real values that I want to zscore normalize:
>> a
array([ nan, 0.0767, 0.4383, 0.7866, 0.8091, 0.195
I am not sure since when this parameter exists, because I have not been working with python for long. But you can simply use the parameter nan_policy = 'omit' and nans are ignored in the calculation:
a = np.array([np.nan, 0.0767, 0.4383, 0.7866, 0.8091, 0.1954, 0.6307, 0.6599, 0.1065, 0.0508])
ZScore_a = stats.zscore(a,nan_policy='omit')
print(ZScore_a)
[nan -1.14832945 0.07147776 1.24641928 1.3223199 -0.74791154
0.72051236 0.81901449 -1.0478033 -1.23569949]