Having a dataframe with a single row, I need to filter it into a smaller one with filtered columns based on a value in a row.
What's the most effective way?
df = pd.DataFrame({'a':[1], 'b':[10], 'c':[3], 'd':[5]})
| a | b | c | d |
|---|---|---|---|
| 1 | 10 | 3 | 5 |
For example top-3 features:
| b | c | d |
|---|---|---|
| 10 | 3 | 5 |