Numpy where and division by zero

后端 未结 5 1138
盖世英雄少女心
盖世英雄少女心 2020-12-04 01:00

I need to compute x in the following way (legacy code):

x = numpy.where(b == 0, a, 1/b) 

I suppose it worked in python-2.x (as

5条回答
提交回复
热议问题