How to remove unnecessary things like (), [], single quotes from PyPpark output

Hi, I'm new to Spark, I joined two key-based RDDs, and I got the following output, which I want to reformat using a spark,

 (676747, (['India', 'Telemart', 'North', 'South', 'Region', 'Area', 'States', '1C-iim'], ((0.0, 'North', 17), (0.0, 'South', 22), (1.0, 'East', 21), (3.0, 'west', 9.0), (7.0, 'MAH', 8.0, (3.0, 'AKL', 9.0), (23.0, 'PNB', 67))))

So, I want to remove all the brackets and want the clean output to like,

676747,India,Telemart,North,South,Region,Area,States,1C-iim,0.0,North,17,0.0,South,22,1.0,East,21 ......

please help me achieve the desired result.

0
source share

Source: https://habr.com/ru/post/1620100/


All Articles