MAINT: sum -> np.sum in matrix_rank