阅读背景:

一个python函数,它接受标量或numpy数组作为参数

来源:互联网 

As the title says, suppose I want to write a sign function (let's forget sign(0) for now), obviously we expect sign(2) = 1 and sign(array([-2,-2,2])) = array([-1,-1,1]). The following function won't work however, because it can't handle numpy arrays.As the title says, suppose I want to write a si




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: