Sum of top q passowrd frequencies

def sumvalues(self, q=0):
        """Sum of top q passowrd frequencies
        """
        if q == 0:
            return self._totalf
        else:
            return -np.partition(-self._freq_list, q)[:q].sum()