当我将相当大的数据集(即Wikipedia的档案)加载到spark数据框中时,收到以下错误:
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
... 1 more
Caused by: java.lang.NullPointerException
at org.apache.spark.ml.feature.Tokenizer$$anonfun$createTransformFunc$1.apply(Tokenizer.scala:39)
at org.apache.spark.ml.feature.Tokenizer$$anonfun$createTransformFunc$1.apply(Tokenizer.scala:39)
在pyspark数据框中删除Null值的最佳方法是什么?
答案 0 :(得分:0)
您可以使用na.drop()
来删除所有包含Null值的行:
df.na.drop()