Message Boards Message Boards

0
|
5295 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

Intersection of two result lists

Posted 10 years ago

Good Morning,

in Mathematica I can easily intersect two Wolfram Alpha result lists, for example "Which countries are members of both, the EU and NATO":

natomembers = EntityList[EntityClass["Country","NorthAtlanticTreatyOrganization"]];
eumembers = EntityList[EntityClass["Country","EuropeanUnion"]];
Intersection[natomembers, eumembers];

However, this doesn't seem to work in the Wolfram Alpha web-interface directly, which would be really neat. I tried several approaches, but they always gives an educated guess. For example:

{eu members} intersect {nato members}

Results to "Using closest Wolfram|Alpha interpretation: nato members". It also doesn't matter which set comes first in the query, it always falls to the NATO result list in this case.

However, a simple intersection operation in Wolfram Alpha like

{1,2,3} intersect {3,4,5}

yields

{3}

Any ideas on this?

Thanks! Alexander.

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