1

I would like to ask a question for the table below for the comparison of np arrays:

 Ticket  Travel Time  Price
 A        10           1700
 B        9            2000
 C        8            1800
 D        7.5          2300
 E        6            2200

I want to compare each row with other ones and find the ones satisfying the criteria:

-If travel time is greater than other price should be less

-If travel time less than others price should be higher

For instance, ticket A,B and C, if they compared with other tickets it satisfies the condition.

At the end I would like to have to list such as satisfies=[A,B,C] not_satisfies=[D,E]

I think most feasible way is comparing with np.all and np.any but could not come up with a logical solution.

Would be appreciated for any suggestions!

0 Answers0