Eliminate NaN tuples from dictionary

Hi All,

I want to eliminate (NaN, NaN) tuple form the blow dictionary. Can you please let me know how I can do this. Thanks in advance!

intersection[(6, 9)]=Any[(1.0, -0.295491), (0.866025, -0.34202), (0.866025, -0.34202), (0.866025, 0.642788), (0.866025, 0.642788), (0.866025, 0.642788), (1.0, 0.642788), (NaN, NaN)]

intersection[(4, 12)]=Any[(1.0, -0.295491), (0.866025, -0.34202), (0.866025, -0.34202), (0.866025, 0.642788), (0.866025, 0.642788), (0.866025, 0.642788), (1.0, 0.642788), (NaN, NaN)]

intersection[(10, 17)]=Any[(1.0, 0.0347929), (0.987629, 0.0170758), (0.987629, 0.0170758), (0.629613, 0.347077), (0.629613, 0.874437), (0.629613, 0.874437), (0.649382, 0.874437), (1.0, 0.551255)]

intersection[(15, 23)]=Any[(1.0, 0.114635), (0.997958, 0.110388), (0.997958, 0.110388), (0.554297, 0.366488), (0.554297, 0.915927), (0.554297, 0.915927), (0.558678, 0.915927), (1.0, 0.661177)]

intersection[(23, 24)]=Any[(1.0, 0.110281), (0.997629, 0.105457), (0.997629, 0.105457), (0.558419, 0.365825), (0.558419, 0.913925), (0.558419, 0.913925), (0.56341, 0.913925), (1.0, 0.65511)]

All the best,
Rasoul

You can use all(isnan, t) or any(isnan, t) to check whether all or any elements of a tuple t are NaN respectively. I recommend using this togeher with filter or filter!. Check the doc string for those functions using ?filter in the REPL to find out more.

For example, on each value you can do

filter!(t -> !any(isnan, t), v)