Skip to content
Advertisement

Using filter and lambda in a list of lists

I working with a list of lists. Each of those lists are the same — they contain title, url and some additional statistics (always in the same order).


My list of lists

I would like to create a function find_title, which takes the wanted title and returns the whole list (with title, url and statistics). That’s my attempt

JavaScript

However it doesn’t work, it returns nothing. That’s probably because x[0] denotes only the first element in the big list. How can it be fixed?

Edit. That’s a part of ls:

JavaScript

Advertisement

Answer

You can directly extract the information from dataframe like this:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement