2017-04-05 2 views
0

ich RDD haben, wie unten,Concatenate Elemente in rdd Liste Python Funken

>>> rdd.collect() 
[([u'steve'], [u'new', u'york'], [u'baseball']), ([u'smith'], [u'virginia'], [u'football'])] 

Wie kann ich neue RDD wie

[([u'steve'], [u'newyork'], [u'baseball']), ([u'smith'], [u'virginia'], [u'football'])] 

ich es versucht, neue rdd zur Karte mit ihm JOIN aber doesnot Arbeit

Antwort

0

ich bin in der Lage, dies zu beheben,

>>> rdd2=rdd.map(lambda l: [''.join(x) for x in l]) 
>>> rdd2.map(tuple).collect() 
[([u'steve'], [u'newyork'], [u'baseball']), ([u'smith'], [u'virginia'], [u'football'])] 
Verwandte Themen