Skip to main content
Tweeted twitter.com/#!/StackMma/status/497416041098915840
Fixed formatting
Source Link
Öskå
  • 8.6k
  • 4
  • 32
  • 50

For example I have two lists of such structure

  L1 = L1={{"Australia",a1}, {"USA",a2}, {"Norway",a3},...}
  L2 = L2={{"Russia",b1}, {"Norway",b2}, {"Japan",b3},...}

I would like to sort contriescountries of the list L2 in the contries'countries' order of L1 to compare it entirely (I mean the values matching for each country). Could you render me some assistance in accomplishing it?! Thus I would like to gain smthsomething resembling this as a result where L3 is the sorted L2:

  L1 = L1={{"Australia",a1}, {"USA",a2}, {"Norway",a3},...}
  L3 = L3={{"Australia",b26},{"USA",b13} {"Norway",b2},...}

For example I have two lists of such structure

    L1={{"Australia",a1}, {"USA",a2}, {"Norway",a3},...}
    L2={{"Russia",b1}, {"Norway",b2}, {"Japan",b3},...}

I would like to sort contries of the list L2 in the contries' order of L1 to compare it entirely (I mean the values matching for each country). Could you render me some assistance in accomplishing it?! Thus I would like to gain smth resembling this as a result where L3 is the sorted L2:

    L1={{"Australia",a1}, {"USA",a2}, {"Norway",a3},...}
    L3={{"Australia",b26},{"USA",b13} {"Norway",b2},...}

For example I have two lists of such structure

L1 = {{"Australia",a1}, {"USA",a2}, {"Norway",a3},...}
L2 = {{"Russia",b1}, {"Norway",b2}, {"Japan",b3},...}

I would like to sort countries of the list L2 in the countries' order of L1 to compare it entirely (I mean the values matching for each country). Thus I would like to gain something resembling this as a result where L3 is the sorted L2:

L1 = {{"Australia",a1}, {"USA",a2}, {"Norway",a3},...}
L3 = {{"Australia",b26},{"USA",b13} {"Norway",b2},...}
Source Link
David
  • 165
  • 3

How to sort my list?

For example I have two lists of such structure

    L1={{"Australia",a1}, {"USA",a2}, {"Norway",a3},...}
    L2={{"Russia",b1}, {"Norway",b2}, {"Japan",b3},...}

I would like to sort contries of the list L2 in the contries' order of L1 to compare it entirely (I mean the values matching for each country). Could you render me some assistance in accomplishing it?! Thus I would like to gain smth resembling this as a result where L3 is the sorted L2:

    L1={{"Australia",a1}, {"USA",a2}, {"Norway",a3},...}
    L3={{"Australia",b26},{"USA",b13} {"Norway",b2},...}