Track the Popularity of Names
Get the most popular names for baby girls and their rankings over time.
In[1]:=
girls = SortBy[
EntityList[
EntityClass[
"GivenName", {"Gender" -> "Female",
"Rank" -> Interval[{1, 10}]}]], #["Rank"] &]
Out[1]=
In[2]:=
ranksgirls =
Table[EntityValue[name,
Dated[EntityProperty["GivenName", "Rank"], All]], {name, girls}];
Plot the rankings for the last 50 years on a log scale that has the most popular name at the top.
In[3]:=
DateListStepPlot[ranksgirls,
ScalingFunctions -> {-Log[#] &, Exp[-#] &}, PlotLegends -> girls,
PlotTheme -> "Business", ImageSize -> 475,
PlotRange -> {{DateObject[{1965}], DateObject[{2015}]}, All}]
Out[3]=
In[4]:=
boys = SortBy[
EntityList[
EntityClass[
"GivenName", {"Gender" -> "Male",
"Rank" -> Interval[{1, 10}]}]], #["Rank"] &];
In[5]:=
ranksboys =
Table[EntityValue[name,
Dated[EntityProperty["GivenName", "Rank"], All]], {name, boys}];
Looking at the rankings for boys' names shows some names have been consistently popular over time.
In[6]:=
DateListStepPlot[ranksboys,
ScalingFunctions -> {-Log[#] &, Exp[-#] &}, PlotLegends -> boys,
PlotTheme -> "Business", ImageSize -> 475,
PlotRange -> {{DateObject[{1965}], DateObject[{2015}]}, All}]
Out[6]=