add set_index_ncol(ncol) to set first n columns as indices
```
df = pd.read_sql('select idx1,idx2,metric1 from table1 ', dbcon)
df.set_index(list(df.columns)[:ncol]).T.to_dict('list')
```

such operations are very frequent in product
