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

Ansible warning on jinja2 braces on when -

Parsing a protocol message from Go by Java -

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