Is it possible to check for NaN in any arbitrary data structure in python?
Essentially, I would like a function, def containsNan(d) which would return True for any arbitrary standard python data structure d, if there is any NaN inside d.
I looked into flattening d, before doing some kind of apply(), with math.isnan() but there doesn't appear to be a general flatten that works on any d.
Any ideas on what approach I should try?