Python Count With Many Conditions

52
October 22, 2019, at 7:40 PM

I need to count values according to "Calculation" and "Order" columns. but i have several conditions like this:

Packed Size  Minimum Quantity   Active  Calculation  Order     Output(Count)
     7               6             1         7         7          0        #it is ok, calculation=order. no need to count
     3               6             0         6         6          1        #"calculation = order" but it shouldn't have any order. because not active day even if there is a calculation. so output is 1.
     3               4             1         3         3          1        #it shouldn't have any order. because calculation and order is lower than minimum quantity. so output is 1.
     4               3             1         4         3          1        #calculation is greater than minimum quantity and active is 1 and multiple of the packed size. so, order should be equal to calculation. output is 1.
     4               3             1         3         4          0        #calculation is lower than order and active is 1. but order must be multiples of 4 and 4 due to packed size column and greater than minimum quantity. so, output is 0. it is ok.
     5               4             1         7         7          1        #calculation and order is equal, active day and they are greater than minimum quantity. but they are not multiples of 5 or 5 due to packed size. so, output is 1.       

How can i get the elegant code that meet this conditions? Could you please help about this?

READ ALSO
Local Storage using JavaScript/jQuery to store the favorites from the list and show the favorites list when the user clicks the favorites tab

Local Storage using JavaScript/jQuery to store the favorites from the list and show the favorites list when the user clicks the favorites tab

I am having a PHP page where the list loads from the databaseI am having a star icon near each item on clicking the icon changes color and that will be stored in the local storage

52
show and hide spinner with jquery : does not work on Iphone, safary etc

show and hide spinner with jquery : does not work on Iphone, safary etc

I am trying to show / hide a spinner with JQueryBasicaly I have this code :

52
Using beforeSend and complete in every instance of ajaxForm globally

Using beforeSend and complete in every instance of ajaxForm globally

I am trying to use the beforeSend and complete functions on all ajaxForms in a projectI would like to do this without adding the exact bit a code all throughout the project

27