Error message in a loop for on pypsark using regexp_replace
问题 i'm making a loop in pyspark, and i have this message: "Column is not iterable" This is the code: (regexp_replace(data_join_result[varibale_choisie], (random.choice(data_join_result.collect()[j][varibale_choisie])), data_join_result.collect()[j][lettre_choisie] )))) in the error message, the problem comes at this moment: data_join_result.collect()[j][lettre_choisie] My input: VARIABLEA | VARIABLEB BLUE | WHITE PINK | DARK My expected output: VARIABLEA | VARIABLEB BLTE