I have to compare each row with a different threshold basis the data of other columns in the data. How can I do so.
For example, I have 5 columns as below.
I have to compare the price column with a threshold derived basis the data distribution of market, product group and price type.
Say I will calculate median for each of these groups such as GBR
, Toys
, Low ASP
. I will compare the price for row 1
i.e. $10 with the median derived for this group i.e. GBR
, Toys
and Low ASP
.
Accordingly my threshold will differ for each row basis the value of attributes of Market, Product Group and Price type). How can I do so? I am stuck with identifying a logic for this in Python.
The data snippet: