I try get the populations of all cities by this common used line

pop0 = Map[{#, CityData[#, "Population"]} &, CityData[All]];

But it gives me this error message

Part::partw: Part 115371 of {944864,944864,944866,944871,945025,945039,945059,945073,945073,945107,945112,945073,945127,945136,945145,945151,945156,945156,945165,945190,945221,945226,945073,945073,945804,944864,944864,945809,945814,945968,945986,945059,945073,945073,946006,946011,945073,946030,946039,946048,946058,945156,945156,945165,946063,945221,946098,945073,945073,945804,<<115100>>} does not exist. >>

Can someone explain what exactly happens here and how I can fix this?

  • 1
    $\begingroup$ The code runs fine for me. 10.4 $\endgroup$ – Feyre Jul 16 '16 at 13:13
  • $\begingroup$ Do you have the full version of Mathematica? Otherwise you might be running into memory issues. $\endgroup$ – Feyre Jul 16 '16 at 13:23
  • $\begingroup$ I know that the code should run. I've found it in multiple examples. I am using Mathematica 10.4 student version and have plenty of ram left. $\endgroup$ – meneken17 Jul 16 '16 at 23:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.