in [ ]grouped fec_mrbo groupby('cand_nm'in [ ]grouped apply(get_top_amounts'contbr_occupation' = out[ ]cand_nm contbr_occupation obamabarack retired attorney not provided homemaker physician lawyer consultant romneymitt retired not provided homemaker attorney president executive namecontb_receipt_amt in [ ]grouped apply(get_top_amounts'contbr_employer' = out[ ]cand_nm contbr_employer obamabarack retired self-employed not employed not provided homemaker student volunteer microsoft sidley austin llp refused romneymitt not provided retired homemaker self-employed student credit suisse morgan stanley goldman sach co barclays capital capital namecontb_receipt_amt bucketing donation amounts useful way to analyze this data is to use the cut function to discretize the contributor amounts into buckets by contribution sizein [ ]bins np array([ ]example federal election commission database www it-ebooks info