Wolfram言語

外部サービス

どちらの都市が完全菜食主義者にとって住みやすいか

FactualのAPIに接続して都市についての情報を得る.

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

2つの都市における完全菜食主義と菜食主義のレストランや食料品店を探す.

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];

場所の数と密度を得る.

完全なWolfram言語入力を表示する
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]=

関連する例

de en es fr ko pt-br ru zh