Given the following list of lists representing column names:

```
names = [['a','b'],['c','c'],['b','c']]

```

and the following dataframe

```
df
   a  b  c
0  1  2  6
1  1  3  2
2  4  6  4

```

I would like to generate the list with the same dimensions as `names` with the following functionality:

```
lst = []
for idx, cols in enumerate(names):
  lst.append([])
  for col in cols:
    lst[-1].append(df.iloc[idx][col])

lst:
[[1,2],[2,2],[6,4]

```

I.e, the `names` array points to the pulled columns from `df` in the relevant `row_idx`.

I'm trying to avoid the nested loop.