names pd concat(piecesignore_index=truethere are couple things to note here firstremember that concat glues the dataframe objects together row-wise by default secondlyyou have to pass ignore_index=true because we're not interested in preserving the original row numbers returned from read_csv so we now have very large dataframe containing all of the names datanow the names dataframe looks likein [ ]names out[ ]int index entries to data columnsname non-null values sex non-null values births non-null values year non-null values dtypesint ( )object( with this data in handwe can already start aggregating the data at the year and sex level using groupby or pivot_tablesee figure - in [ ]total_births names pivot_table('births'rows='year'cols='sex'aggfunc=sumin [ ]total_births tail(out[ ]sex year in [ ]total_births plot(title='total births by sex and year'nextlet' insert column prop with the fraction of babies given each name relative to the total number of births prop value of would indicate that out of every babies was given particular name thuswe group the data by year and sexthen add the new column to each groupdef add_prop(group)integer division floors births group births astype(floatgroup['prop'births births sum(return group names names groupby(['year''sex']apply(add_prop introductory examples www it-ebooks info