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

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

Ansible warning on jinja2 braces on when -

html - How to custom Bootstrap grid height? -