I have a dataframe:
id col1 col2
0 1000 250
1 2000 750
2 1500 350
3 3000 800
4 4500 2500
5 8500 4450
6 6300 1250
I'm trying to find the rows where I can maximize the sum of col2 values, based on/given the total sum for those rows' col1 is <= 15000.
What would be the easiest way to do so?