Menu
CoddyTech

回顾:团队总计

本课属于 Coddy PySpark 学习旅程的“基础知识”单元。第 14 课,共 18 课。

challenge icon

挑战

简单

排除 amount 为 null 或小于零的记录。按 team 对剩余记录分组,并将 amount 求和,命名为 total。返回 team, total,按 total 降序排列;如果 total 相同,则按 team 升序排列。team 名称不为 null。

编写 transform(df) 并返回一个 Spark DataFrame。检查器会提供符合此架构的 df:team string, amount int。会话和 F(PySpark 函数)已可用。不要打印内容;检查器会显示返回的行。按以下顺序返回列:team, total。

亲手试试

def transform(df):
    return df

基础知识中的所有课

自己练习: Python 在线编译器