(a, b)
return result
a/b where the resulted NaN or Inf are replaced by 0.
a/b where the resulted NaN or Inf are replaced by 0.
a / b where the resulted NaN or Inf are replaced by 0 .
def divide_no_nan(a, b):
    """
    a/b where the resulted NaN or Inf are replaced by 0.
    """
    result = a / b
    result[result != result] = .0
    result[result == np.inf] = .0
    return result
def divide_no_nan ( a , b ) : result = a / b result [ result != result ] = .0 result [ result == np . inf ] = .0 return result