比较两个城市对素食者的友好程度
连接到 Factual API 来获取有关位置的信息.
In[1]:=
factual = ServiceConnect["Factual"]
Out[1]=
寻找两个城市中素食主义者和素食的位置.
In[2]:=
resultsSeattle =
factual["PlacesDataset",
"Locality" ->
Entity["City", {"Seattle", "Washington", "UnitedStates"}],
"Query" -> "Vegan and vegetarian food", MaxItems -> 300];
resultsHonolulu =
factual["PlacesDataset",
"Locality" ->
Entity["City", {"Honolulu", "Hawaii", "UnitedStates"}],
"Query" -> "Vegan and vegetarian food", MaxItems -> 300];
获取位置的数目和密度.
显示完整的 Wolfram 语言输入
Out[3]=