What is the fastest way of getting specific indexes from one list and remove from other list python.
a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
b = [nan, 'gfdg', 54.0, nan, 54.0, nan, 'wre', nan, 54, nan]
I want to remove nan from list 'b' and similar index from list 'a' such that the expected result should be:
a = ['b', 'c', 'e', 'g', 'i' ]
b = ['gfdg', 54.0, 54.0, 'wre', 54]