def top(self, topn, by='counts'):
        """
        Get the top ``topn`` features in the :class:`.FeatureSet`\.

        Parameters
        ----------
        topn : int
            Number of features to return.
        by : str
            (default: 'counts') How features should be sorted. Must be 'counts'
            or 'documentcounts'.

        Returns
        -------
        list

        """

        if by not in ['counts', 'documentCounts']:
            raise NameError('kwarg `by` must be "counts" or "documentCounts"')

        cvalues = getattr(self, by)
        order = argsort(list(cvalues.values()))[::-1][:topn]
        keys = list(cvalues.keys())
        return [(self.index[keys[i]], cvalues[keys[i]]) for i in order]