How to filter large dataset to only show specific values while preseveing orginal order and find most common quintuple permutations?
I have a large dataset that contains 1000 unique terms, while the dataset itself has millions of those items repeated throughout. I ran a count of what the top 50 most popular terms are. I only want to see the top 50 item data while preserving the original order. How can I filter my original dataset to only show those top 50 items and then after I have that I want to get a count of the most common quintuple permutations. I am using Python.