Applying a function along a numpy array

后端 未结 4 693
情话喂你
情话喂你 2021-02-07 05:00

I\'ve the following numpy ndarray.

[ -0.54761371  17.04850603   4.86054302]

I want to apply this function to all elements of the array

4条回答
  •  独厮守ぢ
    2021-02-07 05:47

    scipy already implements the function Luckily, Python allows us to rename things upon import:

     from scipy.special import expit as sigmoid
    

提交回复
热议问题