def run(self):
self._func, self._func_code = self.build()<EOL>def process_row(row):<EOL><INDENT>try:<EOL><INDENT>self._func(self._stats, row)<EOL><DEDENT>except TypeError as e:<EOL><INDENT>raise TypeError("<STR_LIT>".format(self._func_code, e))<EOL><DEDENT>except KeyError:<EOL><INDENT>raise KeyError(<EOL>'<STR_LIT>'<EOL>.format(list(row.keys()), self._func_code))<EOL><DEDENT>except Exception as e:<EOL><INDENT>raise type(e)(<EOL>'<STR_LIT>'<EOL>.format(list(row.keys()), self._func_code, e))<EOL><DEDENT><DEDENT>if self._sample_size is None:<EOL><INDENT>for i, row in enumerate(self._source):<EOL><INDENT>process_row(row)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>skip_rate = self._sample_size / self._n_rows<EOL>i = <NUM_LIT:0><EOL>skip = skip_rate<EOL>for j, row in enumerate(self._source):<EOL><INDENT>skip += skip_rate<EOL>if skip >= <NUM_LIT:1>:<EOL><INDENT>skip -= <NUM_LIT:1><EOL>i += <NUM_LIT:1><EOL>process_row(row)<EOL><DEDENT><DEDENT><DEDENT>if i < <NUM_LIT>:  <EOL><INDENT>for k, v in self._stats.items():<EOL><INDENT>v._build_hist_bins()<EOL><DEDENT><DEDENT>return self<EOL>
Run the stats. The source must yield Row proxies.