def test_ignore_nans(self):
""" Test that NaNs are ignored. """
source = [np.ones((16,), dtype = np.float) for _ in range(10)]
source.append(np.full_like(source[0], np.nan))
product = cprod(source, ignore_nan = True)
self.assertTrue(np.allclose(product, np.ones_like(product)))
评论列表
文章目录