def NR(p):
    """Vectorizable, can accept scalars or arrays"""
    # Could also use p**N, which works for arrays
    return np.asarray(p>0,int) * (M*np.power(p,N)/(np.power(s,N)+np.power(p,N)))
dataset/ETHPy150Open robclewley/compneuro/NR_functions.py/NR/original