gpt4 book ai didi

pyspark - 在 Pyspark 中删除行

转载 作者:行者123 更新时间:2023-12-05 04:01:07 25 4
gpt4 key购买 nike

如何根据行号/行索引值删除 Pyspark 中的行值?

我是 Pyspark(和编码)的新手——我尝试编码一些东西,但它不起作用。

最佳答案

您不能删除特定的列,但您可以使用 filter 或其别名 where 过滤您想要的列。

假设您想“删除”一个人的年龄低于 3 岁的行。您可以只保留相反的行,如下所示:

df.filter(df.age >= 3)

关于pyspark - 在 Pyspark 中删除行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55578241/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com