mary, , anna, , emma, , elizabeth, , minnie, , margaret, , ida, , alice, , bertha, , sarah, , as this is nicely comma-separated formit can be loaded into dataframe with pandas read_csvin [ ]import pandas as pd in [ ]names pd read_csv('names/yob txt'names=['name''sex''births']in [ ]names out[ ]int index entries to data columnsname non-null values sex non-null values births non-null values dtypesint ( )object( these files only contain names with at least occurrences in each yearso for simplicity' sake we can use the sum of the births column by sex as the total number of births in that yearin [ ]names groupby('sex'births sum(out[ ]sex namebirths since the data set is split into files by yearone of the first things to do is to assemble all of the data into single dataframe and further to add year field this is easy to do using pandas concat is the last available year right now years range( pieces [columns ['name''sex''births'for year in yearspath 'names/yob% txtyear frame pd read_csv(pathnames=columnsframe['year'year pieces append(frameus baby names - www it-ebooks info