Skip to content

Instantly share code, notes, and snippets.

@msszczep
Created November 13, 2016 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msszczep/56189ad10e9a1625178fa6ca4c7b5c85 to your computer and use it in GitHub Desktop.
Save msszczep/56189ad10e9a1625178fa6ca4c7b5c85 to your computer and use it in GitHub Desktop.
Most Z's on a MLB Team Roster, Mathematica
Count[Characters@ToLowerCase@WolframAlpha["1971 texas rangers roster", {{"Result", 1},  "Plaintext"}, PodStates -> {"More"}], "z"];
MLBTeams = Drop[StringSplit[WolframAlpha["all major league baseball teams", {{"Result", 1},  "Plaintext"}, PodStates -> {"More", "More"}], {"(", "|"}], -1];
Grid[Take[Reverse@SortBy[First@Table[{team, yr, Count[Characters@ToLowerCase@WolframAlpha[ToString[yr] <>  " " <>  team <>  " roster", {{"Result", 1},  "Plaintext"}, PodStates -> {"More"}], "z"]}, {team, MLBTeams}, {yr, Range[1903, 2016]}], Last], 40], Frame-> All]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment