I have Whole\_mat as pandas df. corpus\_index as valid rows that I want to copy into New\_mat, and I want only column numbers 1, 4, and 7. But order should be 7, 1, 4. Below is what I tried but I am getting TypeError: unhashable type: 'list'. Whole mat shape is, say, Nx10, I want nx3 for New\_mat.

```
New_mat = []
for i in range(len(corpus_index):
    index = corpus_index[i]
    New_mat.append(Whole_mat[[index], [7,1,4]])
print New_mat

```

What could be a better way to solve my problem?