I have the following structure:
list_of_tuples = [['portugal', np.nan, 'japan'], [np.nan, 'germany', 'canada'], ['UK', 'US', np.nan]]
I want to change the numpy nan values for MissingValue and turning back to a list of tuples:
final_structure = [('portugal', 'MissingValue', 'japan'), ('MissingValue', 'germany', 'canada'), ('UK', 'US', 'MissingValue')]
How can I replace the elements given a condition without iterating all over the elements? is there any single statement?