non-null values sex non-null values births non-null values year non-null values prop non-null values dtypesfloat ( )int ( )object( figure - proportion of births represented in top names by sex after sorting prop in descending orderwe want to know how many of the most popular names it takes to reach you could write for loop to do thisbut vectorized numpy way is bit more clever taking the cumulative sumcumsumof prop then calling the method searchsorted returns the position in the cumulative sum at which would need to be inserted to keep it in sorted orderin [ ]prop_cumsum df sort_index(by='prop'ascending=falseprop cumsum(in [ ]prop_cumsum[: out[ ] in [ ]prop_cumsum searchsorted( out[ ] introductory examples www it-ebooks info