如何将rdd转换为Dataframe

oug3syen  于 2021-05-16  发布在  Spark
关注(0)|答案(0)|浏览(429)

如何将rdd转换成pysparkDataframe-

hadoopexam = spark.sparkContext.parallelize(["mumbai",[("bigdata",1),("cloud",2)],
                                        "pune",[("bigdata",1),("python",2)],
                                        "punjab",[("mobile",1),("networking",2),("science",2)],
                                        "up",[("networking",1),("database",2)]
                                      ])

我需要下面的结果-

mumbai    [("bigdata",1),("cloud",2)]

    pune      [("bigdata",1),("python",2)]

    punjab    [("mobile",1),("networking",2),("science",2)]

    banglore  [("networking",1),("database",2)]

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题