How to normalize the rows of a NumPy array in Python Use numpy.ndarray.sum() and broadcasting Use sklearn.preprocessing.normalize()