How to find the position of a company given other companies in a Pandas DataFrame with Python
So I have a Pandas DataFrame
. I am doing some data analysis
with Python
with some sets of companies based on the products they offer on my website.
For example, I have a column called ProductID
and another called Company
So to find the most trending products on my website, I can do so by:
df.ProductID.value_counts(normalize=True).nlargest(10).plot(kind="bar")
And each product is offered by a company
, and a company could have several products, that is a company can have several ProductID
. ie Company A
has ProductID
10,12,13,14
How do I find the market position of a company? Keeping in mind that out of the top 10, a company's product could appear up to 3 times or even more depending on the company's popularity
Topic market-basket-analysis visualization pandas python
Category Data Science