Wolfram言語

Knowledgebaseへの幅広いアクセス

ポケモンパワー

Wolfram Knowledgebaseは,科学知識だけでなく人気のある人物や物事についての情報も有している.ここでは,組込みの実体フレームワークを使って,いろいろなポケモンのさまざまな物理的特徴(攻撃・防御点,体重,色)が研究,比較,可視化されている.

すべてのポケモンの攻撃点と防御点の分布をプロットする.

In[1]:=
Click for copyable input
PairedHistogram[EntityValue["Pokemon", "Attack"], EntityValue["Pokemon", "Defense"], ChartLabels -> {"attack", "defense"}, ChartStyle -> {{LightOrange, LightBlue}, None}]
Out[1]=

第6世代ポケモンの攻撃点と防御点のDatasetを作り,プロットする.

In[2]:=
Click for copyable input
stat = EntityValue[Entity[ "Pokemon", { "Generation" -> Entity[ "PokemonGeneration", "GenerationVI"]}], {"Attack", "Defense"}, "Dataset"];
In[3]:=
Click for copyable input
ListPlot[stat, PlotStyle -> Directive[Opacity[0.5], Orange, PointSize[Medium]], AxesLabel -> Automatic, LabelingFunction -> None]
Out[3]=

ポケモンの平均体重を世代ごとに比較しプロットする.

In[4]:=
Click for copyable input
wg = Normal[ GroupBy[Rule @@@ EntityValue["Pokemon", {"Generation", "Weight"}], First -> Last, Mean]]
Out[4]=
In[5]:=
Click for copyable input
BarChart3D[wg[[All, 2]], ChartLegends -> wg[[All, 1]], ChartStyle -> 24]
Out[5]=

隠的に定義された実体クラスを使って最も重いポケモンを3匹求める.

In[6]:=
Click for copyable input
EntityList[EntityClass["Pokemon", {"Weight" -> TakeLargest[3]}]]
Out[6]=
In[7]:=
Click for copyable input
EntityList[EntityClass["Pokemon", {"Weight" -> TakeLargest[3]}]]; EntityValue[%, "Generation"]
Out[7]=

隠的に定義された実体クラスを使って重さが50Kgから100Kgまでの黄色いポケモンを求める.

In[8]:=
Click for copyable input
yellowMidweights = EntityList[ Entity["Pokemon", {"PokedexColor" -> "Yellow", "Weight" -> Between[{ Quantity[50, "Kilograms"], Quantity[100, "Kilograms"]}]}]]
Out[8]=

これらのポケモンのコラージュを重さに基づいた大きさで作る.

In[9]:=
Click for copyable input
ImageCollage[ Rule @@@ EntityValue[yellowMidweights, {"Weight", "Image"}], Background -> White]
Out[9]=

オリジナルグループ(第1世代)のポケモンと最新グループ(第6世代)のポケモンの色を比較する.

完全なWolfram言語入力を表示する
In[10]:=
Click for copyable input
{color1, color6} = Sort[Tally[EntityValue[EntityList[ Entity["Pokemon", {"Generation" -> Entity["PokemonGeneration", #]}]], "PokedexColor"]]] & /@ {"GenerationI", "GenerationVI"};
In[11]:=
Click for copyable input
PieChart3D[{color1[[All, 2]], color6[[All, 2]]}, PlotLabel -> "Gen. I (outer) vs. Gen. VI (inner)", ChartElementFunction -> "ProfileSector3D", SectorOrigin -> {Automatic, 1}, ChartStyle -> (color1[[All, 1]] /. co_Entity :> Symbol[co[[2]]]), ChartLegends -> color1[[All, 1]]]
Out[11]=

関連する例

de en es fr ko pt-br ru zh