python - Numpy only on finite entries -


Here is a brief example of a function. This vector shows the map of a vector, however, entries of the NAN or INX should be ignored. At present it looks random to me. Do you have any suggestions?

  Import samples from SAPPY import data as NPP P (VV): Mask = NP.Synff (vv) y = np.NaN * vv v = vv [mask] Y [ Mask] = 1 / V * (Stats. Hmean (v) / len (v)) Back    

I have come up with this kind of construction: import code from nppy as np with the imported data, only work on valid entries of ## and the same Use the vector y def __f (mcq on func, x) A: Mask = np.isfinite (x) y = np.NaN * xy [mask] = func (x [mask]) return y # Implementation of parity function def __pp (X): return 1 / x * (statistics. Hmean (X) / len (x)) DP PP (VV): Return __f (__PP, VV)

Comments

Popular posts from this blog

python - how we can use ajax() in views.py in django? -

matlab - Using loops to get multiple values into a cell -

python - Sequence Pattern recognition with Pybrain -