Merge list of lists in pySpark RDD

前端 未结 2 1947
傲寒
傲寒 2021-01-15 17:23

I have lists of tuples that I want to combine into one list. I\'ve been able to process the data using lambdas and list comprehension to where I\'m close to being able to u

2条回答
  •  滥情空心
    2021-01-15 17:36

    Thanks to @mrsrinivas for providing the hint...

    test = test.flatMap(lambda xs: [(x[0], x[1]) for x in xs])

提交回复
热议问题