""" Test a 1d list with zero element"""
a=[10, 20, 30, 40, 50, 60, 70, 80, 90, 0]
b = 0.0 // due to exp(-inf)=0
self.do(a, b)
def test_1darray0(self):
""" Test a 1d array with zero element"""
a=np.array([10, 20, 30, 40, 50, 60, 70, 80, 90, 0])
b = 0.0 // due to exp(-inf)=0
After Change
a=[10, 20, 30, 40, 50, 60, 70, 80, 90, 0]
b = 0.0 // due to exp(-inf)=0
olderr = np.seterr(all="ignore")
try:
self.do(a, b)
finally:
np.seterr(**olderr)
def test_1darray0(self):
""" Test a 1d array with zero element"""
a=np.array([10, 20, 30, 40, 50, 60, 70, 80, 90, 0])
b = 0.0 // due to exp(-inf)=0