Can you use with np.errstate(divide='ignore'):?