I tried to find the most common brand/model combinations in the “ebay kleinanzeigen” dataset. I created a dictionary with the combination as a key and the counts as the value:
for col, row in autos.iterrows(): brand = row["brand"] model = row["model"] if (model, brand) not in brand_model_combi: brand_model_combi[(model, brand)] = 1 else: brand_model_combi[(model, brand)] += 1
Now I’ve got a lot of combinations and their counts. I can’t sort them to find the most common combinations though.
Am I on the right way? Does anyone have a solution to get the 5 most common combinations? If so, please let me know.