from pyspark.sql.functions import desc (group_by_dataframe .count() .filter("`count` >= 10") .sort(desc("count"))