See the attached notebook for a formatted version of this and which you can use to experiment with. For others, here is the quick example code that I put together:
(*These are the names imported from the Excel spread sheet on my \
computer:*)
In[3]:= names =
Flatten[First[
Import["/Users/dreiss/Downloads/Mathematica test.xlsx"]]];
(*For testing purposes I am only going to analyze some of them*)
In[4]:= names = Take[names, 25];
In[9]:= names
Out[9]= {"Adam", "Adan", "Aiden", "Al", "Alan", "Albert", "Alec", \
"Alex", "Alexander", "Alexis", "Alfred", "Ali", "Allan", "Allen", \
"Alton", "Alva", "Alvin", "Anderson", "Andrea", "Andy", "Angela", \
"Anthony", "Arden", "Ariel", "Arlen"}
(*Here is a function that can determing how many people there are of \
the specified sex with the name and returns a list with the name, \
number with that name that are male and the number with that name \
which are female.*)
In[23]:= numberOfPeopleWithName[name_String] :=
Module[{resultM, resultF},
resultM =
EntityValue[Entity["GivenName", {name, "UnitedStates", "male"}],
EntityProperty["GivenName", "GivenNameTotal"]];
resultF =
EntityValue[Entity["GivenName", {name, "UnitedStates", "female"}],
EntityProperty["GivenName", "GivenNameTotal"]];
resultM =
If[Head[resultM] === Missing, 0, QuantityMagnitude[resultM]];
resultF =
If[Head[resultF] === Missing, 0, QuantityMagnitude[resultF]];
{name, resultM, resultF}
]
(*Let's test it:*)
In[25]:= numberOfPeopleWithName["Tyler"]
Out[25]= {"Tyler", 524010, 14821}
In[24]:= numberOfPeopleWithName["Alex"]
Out[24]= {"Alex", 216282, 7267}
(*Now let's try it out on the list of names that we \
have. Rememner that queries sent to the cloud curated databases can \
take some time. So doing this with 1000 names may take a bit. Here \
we are only doing it on 25.*)
In[26]:= Map[numberOfPeopleWithName, names]
Out[26]= {{"Adam", 485665, 1941}, {"Adan", 18580, 61}, {"Aiden",
84601, 1287}, {"Al", 12140, 182}, {"Alan", 289465, 953}, {"Albert",
265911, 1649}, {"Alec", 45289, 323}, {"Alex", 216282,
7267}, {"Alexander", 504649, 4069}, {"Alexis", 52158,
296527}, {"Alfred", 134681, 885}, {"Ali", 17791, 7671}, {"Allan",
71835, 220}, {"Allen", 203055, 1374}, {"Alton", 29744,
223}, {"Alva", 4658, 4717}, {"Alvin", 100602, 801}, {"Anderson",
12532, 362}, {"Andrea", 5311, 396766}, {"Andy", 69737,
810}, {"Angela", 1987, 623561}, {"Anthony", 1191047,
6424}, {"Arden", 4118, 3386}, {"Ariel", 14025, 51398}, {"Arlen",
4908, 486}}
Attachments: