I have a list of lists in the following format:
l = [[1,2,3,4], [5,6], [7], [8,9,10]]
and a pandas dataframe with the following column
| Value |
|---|
| 1 |
| 3 |
| 5 |
| 9 |
My goal is to loop through every row in the value column in the dataframe to find what list the value is in. I'd like to create a new column with the first value from the list that the value is in. The result would look something like this.
| Value | List_Val |
|---|---|
| 1 | 1 |
| 3 | 1 |
| 5 | 5 |
| 9 | 8 |
Any help would be greatly appreciated. Thanks!