You never want to use np.linalg.norm: it's slow and unstable. You should be using sklearn.utils.extmath.norm