Message Boards Message Boards

0
|
8611 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:
GROUPS:

"every city in the world whose population exceeds that of australia"

Posted 10 years ago
POSTED BY: Bruce Axtens
2 Replies
Posted 10 years ago
POSTED BY: Xuan Li

Dear Xuan: I had to make small changes in your code, because I was unable to get it to work. It appears that there is no city in world more populous than Australia. So I tryed with Panama and I found 180 cities.

AllCitys = CityData[];
PanamaP = CountryData["Panama", "Population"];
ACP = {#, CityData[#, "Population"]} & /@ AllCitys;
ACP1 = DeleteCases[ACP, {_, x_} /; MatchQ[Head[x], Missing] == True];
Select[ACP1, #[[2]] > PanamaP &][[;; , 1]]
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract