In this post, we will see how to resolve Match unique group from another dataframe – one to many match
Question:
df1 is the information in the box. Each box has a different volume size The volume of box A is 30, B is 25, etc.For example, since the first box volume of df1 is 30, so it can contain first row product(amount 10) of df2 with the second row(amout 5) and the third(amount 13) is equal to 30 because 10+5+13 = 28. (However, if you add up to the 4th row, 10+5+13+15 = 43, which exceeds 30
Python is still a beginner, so please give me advice from many experts. It’s a very important task for me.
match the appropriate box id of df1 in the box id column in df2.
Best Answer:
One way usingpandas.cut
If you have better answer, please add a comment about this, thank you!
Source: Stackoverflow.com
Leave a Review