Here's some dummy data to make it easier to demonstrate (this would be just one set of results from SolveValues
, i.e. the results where y=5):
data = {{72, 5}, {59, 5}, {38, 5}, {51, 5}, {55, 5}, {16, 5}, {93, 5}, {96, 5}, {67, 5}, {8, 5}}
To find the pair whose x
value is largest:
MaximalBy[data, First]
(* {{96, 5}} *)
Notice that it's a list of pairs (just one pair in this case). That's because there may have been several pairs whose first element was the max.
I want to sort the elements in which x has the highest value for each value of y
Okay, if you want them sorted:
SortBy[data, First]
(* {{8, 5}, {16, 5}, {38, 5}, {51, 5}, {55, 5}, {59, 5}, {67, 5}, {72, 5}, {93, 5}, {96, 5}} *)
ReverseSortBy[data, First]
(* {{96, 5}, {93, 5}, {72, 5}, {67, 5}, {59, 5}, {55, 5}, {51, 5}, {38, 5}, {16, 5}, {8, 5}} *)
how to separate this list into two lists
Again, I don't understand this. What are the two lists you want?