Python Forum

Full Version: Grouping Data based on 30% bracket
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello All,

I am sharing use case which I am not sure falls under this forum or not , so need guidance for that. I only have basic knowledge of python.

I have scenario where we have some Vendor data along with its revenue .

Case 1-When all vendors revenue lies in 30% bracket of each other
Name Revenue
Vendor 1 100
Vendor 2 130
Vendor 4 139

Output > (V1,v2,v4)

Case 2-When all vendors revenue lies in 30% bracket of each other
Name Revenue
Vendor 1 100
Vendor 2 130
Vendor 3 5000
Vendor 4 6000
Output > 2 groups (V1,v2) , (v3,v4)

Is there any python existing library which I can use to implement this or I need to write logic where I will compare each vendor's revenue with each other and output like this.