Les chiffres du marathon de Chicago 2015
Le marathon de Chicago 2015 a attiré 45 000 coureurs à Chicago le 11 octobre 2015. Plus de 37 000 d'entre eux ont terminé la course, et les détails des performances de chaque coureur ont été soigneusement enregistrés. Explorez et visualisez les caractéristiques des coureurs et leurs performances à l'aide d'un magasin d'entités personnalisé contenant ces données.
Chargez un magasin d'entités du marathon à partir d'un ResourceObject.
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_180.png)
marathonEntityStore = ResourceData[
ResourceObject[
Association[
"Name" -> "2015 Chicago Marathon Data",
"UUID" -> "7dc77972-cfc3-48dc-8d08-0292c6d2a929",
"ResourceType" -> "DataResource", "Version" -> "1.0.0",
"Description" -> "2015 Chicago Marathon participant data",
"ContentSize" -> Quantity[1990.2215919999999`, "Megabytes"],
"ContentElements" -> {"Content"}]]]
![](assets.en/running-the-numbers-on-the-2015-chicago-marathon/O_129.png)
Enregistrez le magasin pour cette session.
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_181.png)
PrependTo[$EntityStores, marathonEntityStore];
Extrayez le nombre total de coureurs et, à l'aide d'une classe d'entités définie implicitement, le nombre de participants masculins et féminins.
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_182.png)
EntityValue["ChicagoMarathon2015", "EntityCount"]
![](assets.en/running-the-numbers-on-the-2015-chicago-marathon/O_130.png)
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_183.png)
Table[EntityValue[
EntityClass["ChicagoMarathon2015", "Gender" -> gender],
"EntityCount"], {gender, {Entity["Gender", "Male"],
Entity["Gender", "Female"]}}]
![](assets.en/running-the-numbers-on-the-2015-chicago-marathon/O_131.png)
Sélectionnez cinq coureurs au hasard.
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_184.png)
RandomEntity["ChicagoMarathon2015", 5]
![](assets.en/running-the-numbers-on-the-2015-chicago-marathon/O_132.png)
Affichez les propriétés stockées pour un coureur particulier.
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_185.png)
Entity["ChicagoMarathon2015", "Runner145"]["PropertyAssociation"]
Extrayez les totaux des nationalités des coureurs et créez un tableau des nationalités les plus courantes.
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_186.png)
nationalityTallies =
Reverse[SortBy[
Tally[EntityValue["ChicagoMarathon2015",
EntityProperty["ChicagoMarathon2015", "Country"]]], Last]];
![](assets.en/running-the-numbers-on-the-2015-chicago-marathon/O_134.png)
Visualisez les trajectoires géodésiques de tous les pays d'origine jusqu'à Chicago.
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_188.png)
With[{chicago =
Entity["City", {"Chicago", "Illinois", "UnitedStates"}]},
GeoGraphics[{Darker[Green],
GeoPath[{chicago, #} & /@ nationalityTallies[[All, 1]],
"Geodesic"]},
GeoRange -> "World",
GeoProjection -> "Robinson",
GeoCenter -> chicago]]
![](assets.en/running-the-numbers-on-the-2015-chicago-marathon/O_135.png)
Créez une carte thermique des États-Unis montrant les lieux d'origine des participants américains.
![](assets.en/running-the-numbers-on-the-2015-chicago-marathon/O_136.png)
Trouvez le nombre de coureurs par variation par rapport à la moyenne.
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_193.png)
allkm = Table[
Normal[allTimeSplits[[i]][2 ;;, "Time"]], {i,
Length[allTimeSplits]}];
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_194.png)
allsplitbins = DeleteMissing[Transpose[allkm], 2];
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_195.png)
meanall = Table[N[Mean[allsplitbins[[i]]]], {i, Length[allsplitbins]}]
![](assets.en/running-the-numbers-on-the-2015-chicago-marathon/O_137.png)
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_196.png)
marathondistances = (allTimeSplits[[1]])[All, "Split"] // Normal
![](assets.en/running-the-numbers-on-the-2015-chicago-marathon/O_138.png)
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_197.png)
differencesall = Table[{marathondistances[[i + 1]],
allsplitbins[[i]] - meanall[[i]]},
{i, Length[allsplitbins]}];
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_198.png)
allHistograms =
Histogram[#2, {60}, PlotLabel -> NumberForm[#1, {3, 1}]] & @@@
differencesall;
Créez des histogrammes pour chaque division.
![Click for copyable input](assets.en/running-the-numbers-on-the-2015-chicago-marathon/In_199.png)
Grid[Partition[allHistograms, UpTo[3]]]
![](assets.en/running-the-numbers-on-the-2015-chicago-marathon/O_139.png)
Tracez une distribution à noyau lisse des différences entre les écarts et les moyennes des coureurs.
![](assets.en/running-the-numbers-on-the-2015-chicago-marathon/O_140.png)