如何将MapPartitionsRDD转换为数据帧?

时间:2016-10-12 16:02:45

标签: apache-spark pyspark apache-spark-mllib

我从:

返回了MapPartitionsRDD
from pyspark.mllib.feature import Normalizer
normalizer = Normalizer()
rating = normalizer.transform(ratingRDD)
print(rating)

> MapPartitionsRDD[239] at mapPartitions at PythonMLLibAPI.scala:1522

如何将其转换为数据框?

1 个答案:

答案 0 :(得分:1)

尝试:

rating.map(lambda x: (x, )).toDF()