📅  最后修改于: 2022-03-11 14:55:01.744000             🧑  作者: Mango
from pyspark.sql.functions import *
from pyspark.sql.window import Window
ranked = df.withColumn(
"rank", dense_rank().over(Window.partitionBy("A").orderBy(desc("C"))))