Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (120 points)
recategorized ago by
Let's say I have 2 RDDS:

rdd1 = [a, b, c, d]

rdd2 = [[], [a, d], [a, e], [c]]

Now let's say I want to filter the second rdd so that it only contains elements in rdd1. so after filtering it should look like

rdd2 = [[], [a, d], [a], [c]]

Nex. I want to combine them into one list like this

[[a, []], [b, [a, d], [c, [a]], [d, [c]]

How do I do this in Python?
Please log in to answer this question.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...