Normalizing vector produces nan in Numpy
问题 I'm getting some strange behavior from scipy/numpy that I suspect is a bug but someone may know better? I've got a pair of long arrays which I'm breaking into frames which are of length 2-4 for debugging purposes. I want to normalize each pair of frames and take the dot product. The code that does it (with some debugging output) is: tf = numpy.copy(t_frame) / norm(t_frame) pf = numpy.copy(p_frame) / norm(p_frame) print "OPF:" print p_frame print "PF: " print pf print "TF norm is: " + str(norm