spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eike von Seggern <eike.segg...@sevenval.com>
Subject Re: Pyspark create RDD of dictionary
Date Fri, 02 Nov 2018 15:47:49 GMT
Hi,

Soheil Pourbafrani <soheil.ir08@gmail.com> schrieb am Fr., 2. Nov. 2018 um
15:43 Uhr:

> Hi, I have an RDD of the form (((a), (b), (c), (d)), (e)) and I want to
> transform every row to a dictionary of the form a:(b, c, d, e)
>
> Here is my code, but it's errorful!
>
> map(lambda row : {row[0][0] : (row[1], row[0][1], row[0][2], row[0][3]))
>
> You're missing a `}`:

lambda row: {row[0][0]: (...)*}*

HTH

Eike

Mime
View raw message