I have an array like w=[0.854,0,0.66,0.245,0,0,0,0]
and want to apply 100/sqrt(x) on each value. As I can't divide by 0, I'm using this trick :
w=np.where(w==0,0,100/np.sqrt(w))
As I'm not dividing by 0, I shouldn't have any warning.
So why does numpy keep raising RuntimeWarning: divide by zero encountered in true_divide
?