Wolfram Language

Servicios externos

Compare qué tan amigables con los veganos son dos ciudades

Conéctese al API Factual para obtener información acerca de ubicaciones.

In[1]:=
Click for copyable input
factual = ServiceConnect["Factual"]
Out[1]=

Busque por locales de comida vegetariana y vegana en dos ciudades.

In[2]:=
Click for copyable input
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];

Obtenga el número de locales y densidad.

muestre la entrada completa de Wolfram Language
In[3]:=
Click for copyable input
TextGrid[{{"City", "Area", "Number of locations", "Density"}, {Entity[ "City", {"Seattle", "Washington", "UnitedStates"}], Entity["City", {"Seattle", "Washington", "UnitedStates"}]["Area"], Length[resultsSeattle], Length[resultsSeattle]/ Entity["City", {"Seattle", "Washington", "UnitedStates"}][ "Area"]}, {Entity[ "City", {"Honolulu", "Hawaii", "UnitedStates"}], Entity["City", {"Honolulu", "Hawaii", "UnitedStates"}]["Area"], Length[resultsHonolulu], Length[resultsHonolulu]/ Entity["City", {"Honolulu", "Hawaii", "UnitedStates"}]["Area"]}}, Frame -> All]
Out[3]=

Ejemplos relacionados

de en fr ja ko pt-br ru zh