Re: Maximum in a list
- To: mathgroup at smc.vnet.net
- Subject: [mg97252] Re: [mg97209] Maximum in a list
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Mon, 9 Mar 2009 01:05:46 -0500 (EST)
- Reply-to: hanlonr at cox.net
mylist = {{1, 2}, {3, 4}, {8, 3}, {0, 4}}; Select[mylist, #[[2]] == Max[mylist[[All, 2]]] &] {{3, 4}, {0, 4}} Cases[mylist, {_, Max[mylist[[All, 2]]]}] {{3, 4}, {0, 4}} Bob Hanlon ---- pacotomi <pacotomi at orange.fr> wrote: ============= Hi, Suppose a list mylist={{1,2},{3,4},{8,3}} I would like to extract the element {i,j} of mylist for which j is max (here, it is the second one {3,4}). Somebody could help me, please? Pacotomi