I have a parallelized list of tuples in the format:
data= [('Emily', (4, 2)),
('Alfred', (1, 12)),
('George', (10, 2))]
list = sc.parallelize(data)
What I want is to multiply the integers within the tuples which will give me this output:
[('Emily', (8)),
('Alfred', (12)),
('George', (20))]
I have tried:
list = list.map(lambda x: (x[0], x[1]*x[2]))
But with not effect.