Sort a list by elements of another listOrdered indices of a multiple product or sumImporting, sorting and exporting listsThe efficiency compare between Flatten[#, 1] & and Join @@ # &Lexicographic ordering of lists-of-lists?Problem with Custom Sort/Split/GatherApplying multiple functions to a single column in a tableList of (sub-)lists - query sub-lists by names?Find positions in which list elements are equalHow can I check if elements between lists are equal?comparing lists of strings

You cannot touch me, but I can touch you, who am I?

How did Doctor Strange see the winning outcome in Avengers: Infinity War?

Are student evaluations of teaching assistants read by others in the faculty?

Is there a good way to store credentials outside of a password manager?

How do scammers retract money, while you can’t?

What is the intuitive meaning of having a linear relationship between the logs of two variables?

Why not increase contact surface when reentering the atmosphere?

Unexpected indention in bibliography items (beamer)

Applicability of Single Responsibility Principle

Did Dumbledore lie to Harry about how long he had James Potter's invisibility cloak when he was examining it? If so, why?

How to draw lines on a tikz-cd diagram

What is the opposite of 'gravitas'?

Closest Prime Number

Italian words for tools

Is expanding the research of a group into machine learning as a PhD student risky?

Why, precisely, is argon used in neutrino experiments?

Failed to fetch jessie backports repository

How to write papers efficiently when English isn't my first language?

How can I kill an app using Terminal?

Why escape if the_content isnt?

Why Were Madagascar and New Zealand Discovered So Late?

How do I go from 300 unfinished/half written blog posts, to published posts?

CREATE opcode: what does it really do?

Why are there no referendums in the US?



Sort a list by elements of another list


Ordered indices of a multiple product or sumImporting, sorting and exporting listsThe efficiency compare between Flatten[#, 1] & and Join @@ # &Lexicographic ordering of lists-of-lists?Problem with Custom Sort/Split/GatherApplying multiple functions to a single column in a tableList of (sub-)lists - query sub-lists by names?Find positions in which list elements are equalHow can I check if elements between lists are equal?comparing lists of strings













8












$begingroup$


I know there are a plenty of other questions here which appear to be similar, however I did not found anything which could give me a hint.



I have two lists:



list1 = A, 12, B, 10, C, 4; (*ordered according to the second column*)
list2 = B, 5, A, 4, C, 1; (*ordered according to the second column*)


Now I want to sort list2according to the list1-order so the output should be:



(* A, 4, B, 5, C, 1 *)









share|improve this question











$endgroup$











  • $begingroup$
    to be more specific list2should be sorted according to the first column of list1
    $endgroup$
    – M.A.
    3 hours ago















8












$begingroup$


I know there are a plenty of other questions here which appear to be similar, however I did not found anything which could give me a hint.



I have two lists:



list1 = A, 12, B, 10, C, 4; (*ordered according to the second column*)
list2 = B, 5, A, 4, C, 1; (*ordered according to the second column*)


Now I want to sort list2according to the list1-order so the output should be:



(* A, 4, B, 5, C, 1 *)









share|improve this question











$endgroup$











  • $begingroup$
    to be more specific list2should be sorted according to the first column of list1
    $endgroup$
    – M.A.
    3 hours ago













8












8








8


1



$begingroup$


I know there are a plenty of other questions here which appear to be similar, however I did not found anything which could give me a hint.



I have two lists:



list1 = A, 12, B, 10, C, 4; (*ordered according to the second column*)
list2 = B, 5, A, 4, C, 1; (*ordered according to the second column*)


Now I want to sort list2according to the list1-order so the output should be:



(* A, 4, B, 5, C, 1 *)









share|improve this question











$endgroup$




I know there are a plenty of other questions here which appear to be similar, however I did not found anything which could give me a hint.



I have two lists:



list1 = A, 12, B, 10, C, 4; (*ordered according to the second column*)
list2 = B, 5, A, 4, C, 1; (*ordered according to the second column*)


Now I want to sort list2according to the list1-order so the output should be:



(* A, 4, B, 5, C, 1 *)






list-manipulation sorting






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 1 hour ago









MarcoB

37.9k556114




37.9k556114










asked 3 hours ago









M.A.M.A.

815




815











  • $begingroup$
    to be more specific list2should be sorted according to the first column of list1
    $endgroup$
    – M.A.
    3 hours ago
















  • $begingroup$
    to be more specific list2should be sorted according to the first column of list1
    $endgroup$
    – M.A.
    3 hours ago















$begingroup$
to be more specific list2should be sorted according to the first column of list1
$endgroup$
– M.A.
3 hours ago




$begingroup$
to be more specific list2should be sorted according to the first column of list1
$endgroup$
– M.A.
3 hours ago










3 Answers
3






active

oldest

votes


















5












$begingroup$

Permute[list2, FindPermutation[ list2[[All,1]] , list1[[All,1]] ] ]



A, 4, B, 5, C, 1







share|improve this answer











$endgroup$












  • $begingroup$
    Actually, I like your solution much better than mine. By the way, when I found out that my former solution was incorrect, I also realized that your solution should better be Permute[list2, FindPermutation[list2[[All, 1]], list1[[All, 1]]]].
    $endgroup$
    – Henrik Schumacher
    1 hour ago






  • 1




    $begingroup$
    Doh...fixed it. Both ways give the same answer, which leads to sloppy debugging.
    $endgroup$
    – MikeY
    1 hour ago


















6












$begingroup$

list1 = A, 12, B, 10, C, 4, D, 2;
list2 = A, 4, D, 11, B, 5, C, 1;

idx = Lookup[
AssociationThread[list1[[All, 1]] -> Range[Length[list1]]],
list2[[All, 1]]
];
result = list2;
result[[idx]] = list2;
result



A, 4, B, 5, C, 1, D, 11







share|improve this answer











$endgroup$












  • $begingroup$
    works well with the example lists. However, something goes wrong when I use other lists with Strings in the first columns instead of A, Band C....
    $endgroup$
    – M.A.
    51 mins ago


















1












$begingroup$

ugly but fast:



list2[[Ordering[list2][[Ordering[Ordering[list1]]]]]]



A, 4, B, 5, C, 1




even faster:



result = list2;
result[[Ordering[list1]]] = Sort[list2];
result



A, 4, B, 5, C, 1




benchmarks



s = 10^7;
list1 = Transpose[PermutationReplace[Range[s], RandomPermutation[s]],
RandomInteger[0, 10, s]];
list2 = Transpose[PermutationReplace[Range[s], RandomPermutation[s]],
RandomInteger[0, 10, s]];

(* my first solution *)
result1 = list2[[Ordering[list2][[Ordering[Ordering[list1]]]]]]; //AbsoluteTiming//First
(* 10.5831 *)

(* my second solution *)
result2 = Module[L,
L = list2;
L[[Ordering[list1]]] = Sort[list2];
L]; //AbsoluteTiming//First
(* 8.45556 *)

(* MikeY's solution *)
result3 = Permute[list2, FindPermutation[list2[[All, 1]], list1[[All, 1]]]]; //AbsoluteTiming//First
(* 16.273 *)

(* Henrik Schumacher's solution *)
result4 = Module[idx, L,
idx = Lookup[AssociationThread[list1[[All, 1]] -> Range[Length[list1]]], list2[[All, 1]]];
L = list2;
L[[idx]] = list2;
L]; //AbsoluteTiming//First
(* 32.0212 *)

(* make sure all methods agree *)
result1 == result2 == result3 == result4
(* True *)





share|improve this answer











$endgroup$












    Your Answer





    StackExchange.ifUsing("editor", function ()
    return StackExchange.using("mathjaxEditing", function ()
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    );
    );
    , "mathjax-editing");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "387"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f194061%2fsort-a-list-by-elements-of-another-list%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    5












    $begingroup$

    Permute[list2, FindPermutation[ list2[[All,1]] , list1[[All,1]] ] ]



    A, 4, B, 5, C, 1







    share|improve this answer











    $endgroup$












    • $begingroup$
      Actually, I like your solution much better than mine. By the way, when I found out that my former solution was incorrect, I also realized that your solution should better be Permute[list2, FindPermutation[list2[[All, 1]], list1[[All, 1]]]].
      $endgroup$
      – Henrik Schumacher
      1 hour ago






    • 1




      $begingroup$
      Doh...fixed it. Both ways give the same answer, which leads to sloppy debugging.
      $endgroup$
      – MikeY
      1 hour ago















    5












    $begingroup$

    Permute[list2, FindPermutation[ list2[[All,1]] , list1[[All,1]] ] ]



    A, 4, B, 5, C, 1







    share|improve this answer











    $endgroup$












    • $begingroup$
      Actually, I like your solution much better than mine. By the way, when I found out that my former solution was incorrect, I also realized that your solution should better be Permute[list2, FindPermutation[list2[[All, 1]], list1[[All, 1]]]].
      $endgroup$
      – Henrik Schumacher
      1 hour ago






    • 1




      $begingroup$
      Doh...fixed it. Both ways give the same answer, which leads to sloppy debugging.
      $endgroup$
      – MikeY
      1 hour ago













    5












    5








    5





    $begingroup$

    Permute[list2, FindPermutation[ list2[[All,1]] , list1[[All,1]] ] ]



    A, 4, B, 5, C, 1







    share|improve this answer











    $endgroup$



    Permute[list2, FindPermutation[ list2[[All,1]] , list1[[All,1]] ] ]



    A, 4, B, 5, C, 1








    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited 1 hour ago

























    answered 1 hour ago









    MikeYMikeY

    3,528714




    3,528714











    • $begingroup$
      Actually, I like your solution much better than mine. By the way, when I found out that my former solution was incorrect, I also realized that your solution should better be Permute[list2, FindPermutation[list2[[All, 1]], list1[[All, 1]]]].
      $endgroup$
      – Henrik Schumacher
      1 hour ago






    • 1




      $begingroup$
      Doh...fixed it. Both ways give the same answer, which leads to sloppy debugging.
      $endgroup$
      – MikeY
      1 hour ago
















    • $begingroup$
      Actually, I like your solution much better than mine. By the way, when I found out that my former solution was incorrect, I also realized that your solution should better be Permute[list2, FindPermutation[list2[[All, 1]], list1[[All, 1]]]].
      $endgroup$
      – Henrik Schumacher
      1 hour ago






    • 1




      $begingroup$
      Doh...fixed it. Both ways give the same answer, which leads to sloppy debugging.
      $endgroup$
      – MikeY
      1 hour ago















    $begingroup$
    Actually, I like your solution much better than mine. By the way, when I found out that my former solution was incorrect, I also realized that your solution should better be Permute[list2, FindPermutation[list2[[All, 1]], list1[[All, 1]]]].
    $endgroup$
    – Henrik Schumacher
    1 hour ago




    $begingroup$
    Actually, I like your solution much better than mine. By the way, when I found out that my former solution was incorrect, I also realized that your solution should better be Permute[list2, FindPermutation[list2[[All, 1]], list1[[All, 1]]]].
    $endgroup$
    – Henrik Schumacher
    1 hour ago




    1




    1




    $begingroup$
    Doh...fixed it. Both ways give the same answer, which leads to sloppy debugging.
    $endgroup$
    – MikeY
    1 hour ago




    $begingroup$
    Doh...fixed it. Both ways give the same answer, which leads to sloppy debugging.
    $endgroup$
    – MikeY
    1 hour ago











    6












    $begingroup$

    list1 = A, 12, B, 10, C, 4, D, 2;
    list2 = A, 4, D, 11, B, 5, C, 1;

    idx = Lookup[
    AssociationThread[list1[[All, 1]] -> Range[Length[list1]]],
    list2[[All, 1]]
    ];
    result = list2;
    result[[idx]] = list2;
    result



    A, 4, B, 5, C, 1, D, 11







    share|improve this answer











    $endgroup$












    • $begingroup$
      works well with the example lists. However, something goes wrong when I use other lists with Strings in the first columns instead of A, Band C....
      $endgroup$
      – M.A.
      51 mins ago















    6












    $begingroup$

    list1 = A, 12, B, 10, C, 4, D, 2;
    list2 = A, 4, D, 11, B, 5, C, 1;

    idx = Lookup[
    AssociationThread[list1[[All, 1]] -> Range[Length[list1]]],
    list2[[All, 1]]
    ];
    result = list2;
    result[[idx]] = list2;
    result



    A, 4, B, 5, C, 1, D, 11







    share|improve this answer











    $endgroup$












    • $begingroup$
      works well with the example lists. However, something goes wrong when I use other lists with Strings in the first columns instead of A, Band C....
      $endgroup$
      – M.A.
      51 mins ago













    6












    6








    6





    $begingroup$

    list1 = A, 12, B, 10, C, 4, D, 2;
    list2 = A, 4, D, 11, B, 5, C, 1;

    idx = Lookup[
    AssociationThread[list1[[All, 1]] -> Range[Length[list1]]],
    list2[[All, 1]]
    ];
    result = list2;
    result[[idx]] = list2;
    result



    A, 4, B, 5, C, 1, D, 11







    share|improve this answer











    $endgroup$



    list1 = A, 12, B, 10, C, 4, D, 2;
    list2 = A, 4, D, 11, B, 5, C, 1;

    idx = Lookup[
    AssociationThread[list1[[All, 1]] -> Range[Length[list1]]],
    list2[[All, 1]]
    ];
    result = list2;
    result[[idx]] = list2;
    result



    A, 4, B, 5, C, 1, D, 11








    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited 1 hour ago

























    answered 3 hours ago









    Henrik SchumacherHenrik Schumacher

    58.1k580160




    58.1k580160











    • $begingroup$
      works well with the example lists. However, something goes wrong when I use other lists with Strings in the first columns instead of A, Band C....
      $endgroup$
      – M.A.
      51 mins ago
















    • $begingroup$
      works well with the example lists. However, something goes wrong when I use other lists with Strings in the first columns instead of A, Band C....
      $endgroup$
      – M.A.
      51 mins ago















    $begingroup$
    works well with the example lists. However, something goes wrong when I use other lists with Strings in the first columns instead of A, Band C....
    $endgroup$
    – M.A.
    51 mins ago




    $begingroup$
    works well with the example lists. However, something goes wrong when I use other lists with Strings in the first columns instead of A, Band C....
    $endgroup$
    – M.A.
    51 mins ago











    1












    $begingroup$

    ugly but fast:



    list2[[Ordering[list2][[Ordering[Ordering[list1]]]]]]



    A, 4, B, 5, C, 1




    even faster:



    result = list2;
    result[[Ordering[list1]]] = Sort[list2];
    result



    A, 4, B, 5, C, 1




    benchmarks



    s = 10^7;
    list1 = Transpose[PermutationReplace[Range[s], RandomPermutation[s]],
    RandomInteger[0, 10, s]];
    list2 = Transpose[PermutationReplace[Range[s], RandomPermutation[s]],
    RandomInteger[0, 10, s]];

    (* my first solution *)
    result1 = list2[[Ordering[list2][[Ordering[Ordering[list1]]]]]]; //AbsoluteTiming//First
    (* 10.5831 *)

    (* my second solution *)
    result2 = Module[L,
    L = list2;
    L[[Ordering[list1]]] = Sort[list2];
    L]; //AbsoluteTiming//First
    (* 8.45556 *)

    (* MikeY's solution *)
    result3 = Permute[list2, FindPermutation[list2[[All, 1]], list1[[All, 1]]]]; //AbsoluteTiming//First
    (* 16.273 *)

    (* Henrik Schumacher's solution *)
    result4 = Module[idx, L,
    idx = Lookup[AssociationThread[list1[[All, 1]] -> Range[Length[list1]]], list2[[All, 1]]];
    L = list2;
    L[[idx]] = list2;
    L]; //AbsoluteTiming//First
    (* 32.0212 *)

    (* make sure all methods agree *)
    result1 == result2 == result3 == result4
    (* True *)





    share|improve this answer











    $endgroup$

















      1












      $begingroup$

      ugly but fast:



      list2[[Ordering[list2][[Ordering[Ordering[list1]]]]]]



      A, 4, B, 5, C, 1




      even faster:



      result = list2;
      result[[Ordering[list1]]] = Sort[list2];
      result



      A, 4, B, 5, C, 1




      benchmarks



      s = 10^7;
      list1 = Transpose[PermutationReplace[Range[s], RandomPermutation[s]],
      RandomInteger[0, 10, s]];
      list2 = Transpose[PermutationReplace[Range[s], RandomPermutation[s]],
      RandomInteger[0, 10, s]];

      (* my first solution *)
      result1 = list2[[Ordering[list2][[Ordering[Ordering[list1]]]]]]; //AbsoluteTiming//First
      (* 10.5831 *)

      (* my second solution *)
      result2 = Module[L,
      L = list2;
      L[[Ordering[list1]]] = Sort[list2];
      L]; //AbsoluteTiming//First
      (* 8.45556 *)

      (* MikeY's solution *)
      result3 = Permute[list2, FindPermutation[list2[[All, 1]], list1[[All, 1]]]]; //AbsoluteTiming//First
      (* 16.273 *)

      (* Henrik Schumacher's solution *)
      result4 = Module[idx, L,
      idx = Lookup[AssociationThread[list1[[All, 1]] -> Range[Length[list1]]], list2[[All, 1]]];
      L = list2;
      L[[idx]] = list2;
      L]; //AbsoluteTiming//First
      (* 32.0212 *)

      (* make sure all methods agree *)
      result1 == result2 == result3 == result4
      (* True *)





      share|improve this answer











      $endgroup$















        1












        1








        1





        $begingroup$

        ugly but fast:



        list2[[Ordering[list2][[Ordering[Ordering[list1]]]]]]



        A, 4, B, 5, C, 1




        even faster:



        result = list2;
        result[[Ordering[list1]]] = Sort[list2];
        result



        A, 4, B, 5, C, 1




        benchmarks



        s = 10^7;
        list1 = Transpose[PermutationReplace[Range[s], RandomPermutation[s]],
        RandomInteger[0, 10, s]];
        list2 = Transpose[PermutationReplace[Range[s], RandomPermutation[s]],
        RandomInteger[0, 10, s]];

        (* my first solution *)
        result1 = list2[[Ordering[list2][[Ordering[Ordering[list1]]]]]]; //AbsoluteTiming//First
        (* 10.5831 *)

        (* my second solution *)
        result2 = Module[L,
        L = list2;
        L[[Ordering[list1]]] = Sort[list2];
        L]; //AbsoluteTiming//First
        (* 8.45556 *)

        (* MikeY's solution *)
        result3 = Permute[list2, FindPermutation[list2[[All, 1]], list1[[All, 1]]]]; //AbsoluteTiming//First
        (* 16.273 *)

        (* Henrik Schumacher's solution *)
        result4 = Module[idx, L,
        idx = Lookup[AssociationThread[list1[[All, 1]] -> Range[Length[list1]]], list2[[All, 1]]];
        L = list2;
        L[[idx]] = list2;
        L]; //AbsoluteTiming//First
        (* 32.0212 *)

        (* make sure all methods agree *)
        result1 == result2 == result3 == result4
        (* True *)





        share|improve this answer











        $endgroup$



        ugly but fast:



        list2[[Ordering[list2][[Ordering[Ordering[list1]]]]]]



        A, 4, B, 5, C, 1




        even faster:



        result = list2;
        result[[Ordering[list1]]] = Sort[list2];
        result



        A, 4, B, 5, C, 1




        benchmarks



        s = 10^7;
        list1 = Transpose[PermutationReplace[Range[s], RandomPermutation[s]],
        RandomInteger[0, 10, s]];
        list2 = Transpose[PermutationReplace[Range[s], RandomPermutation[s]],
        RandomInteger[0, 10, s]];

        (* my first solution *)
        result1 = list2[[Ordering[list2][[Ordering[Ordering[list1]]]]]]; //AbsoluteTiming//First
        (* 10.5831 *)

        (* my second solution *)
        result2 = Module[L,
        L = list2;
        L[[Ordering[list1]]] = Sort[list2];
        L]; //AbsoluteTiming//First
        (* 8.45556 *)

        (* MikeY's solution *)
        result3 = Permute[list2, FindPermutation[list2[[All, 1]], list1[[All, 1]]]]; //AbsoluteTiming//First
        (* 16.273 *)

        (* Henrik Schumacher's solution *)
        result4 = Module[idx, L,
        idx = Lookup[AssociationThread[list1[[All, 1]] -> Range[Length[list1]]], list2[[All, 1]]];
        L = list2;
        L[[idx]] = list2;
        L]; //AbsoluteTiming//First
        (* 32.0212 *)

        (* make sure all methods agree *)
        result1 == result2 == result3 == result4
        (* True *)






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 21 mins ago

























        answered 1 hour ago









        RomanRoman

        3,6951020




        3,6951020



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Mathematica Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f194061%2fsort-a-list-by-elements-of-another-list%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to create a command for the “strange m” symbol in latex? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)How do you make your own symbol when Detexify fails?Writing bold small caps with mathpazo packageplus-minus symbol with parenthesis around the minus signGreek character in Beamer document titleHow to create dashed right arrow over symbol?Currency symbol: Turkish LiraDouble prec as a single symbol?Plus Sign Too Big; How to Call adfbullet?Is there a TeX macro for three-legged pi?How do I get my integral-like symbol to align like the integral?How to selectively substitute a letter with another symbol representing the same letterHow do I generate a less than symbol and vertical bar that are the same height?

            Category:Tremithousa Media in category "Tremithousa"Navigation menuUpload media34° 49′ 02.7″ N, 32° 26′ 37.32″ EOpenStreetMapGoogle EarthProximityramaReasonatorScholiaStatisticsWikiShootMe

            Dokschytsy (Steed) Kwelen | NawigatsjuunBelarus: Vitebsk Region, citypopulation.de