How to extract feature from dataset by python like :
I find two ways to slove this problem. 1) One is:
2) Another is :
Search C and D column to find topK items, and only keep the topK. But it will lead to the information loss.
Is there a better way to solve this problem?