I'm attempting to remove all nan list items from a nested list
l1= 
[['a', 'b', 'c', 'd', 'e', 'f'],
 [1.0, 2.0, 3.0, 4.0, 5.0, nan],
 ['red', 'orange', 'blue', nan, nan, nan]]
I've tried the following
cleanedList = [x for x in l1 if str(x) != 'nan']
However, this returns the same output
 
     
    