I have an issue I cannot go thorugh. I need list of lists instead of list of lists of lists? Is there any simple command that 'unlists' one level of such 'deep' list in Python? Here is what I have:
[[['this', 'is', 'the', 'good', 'machine', 'learning', 'book']],
[['this', 'is', 'another', 'book']]]
and where I need to get to:
[['this', 'is', 'the', 'good', 'machine', 'learning', 'book'],
['this', 'is', 'another', 'book']]
I was trying to resolve it with function below
from pandas.core.common import flatten
list(flatten(x))
...but it breaks everything into one list...
['this', 'is', 'the', 'good', 'machine', 'learning', 'book', 'this', 'is', 'another', 'book']
Pls help :)