python - Flattening nan values causes errors -


i trying flatten python3 list has nan in , causing error.

the code using flatten list is

def flatten(x):     if isinstance(x, collections.iterable):         return [a in x in flatten(i)]     else:         return [x] 

from flatten (an irregular) list of lists. works great lists [1,[123,132], 1] doesn't work on list [nan, ['fiction', 'flash', 'short-story'], nan, nan, nan] nans come empty spaces in pandas dataframe.

i error runtimeerror: maximum recursion depth exceeded in cmp


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -