def __init__(self, source, schema, distribution=False, descriptive=False, sample_values=False,<EOL>n_rows=None, sample_size=None):
self._source = source<EOL>self._stats = {}<EOL>self._func = None<EOL>self._func_code = None<EOL>self._n_rows = n_rows<EOL>self._sample_size = sample_size<EOL>self._distribution = distribution<EOL>self._descriptive = descriptive<EOL>self._sample_values = sample_values<EOL>if bool(self._sample_size) ^ bool(self._n_rows):<EOL><INDENT>raise StatsError("<STR_LIT>")<EOL><DEDENT>if self._sample_size is not None and self._n_rows is not None and (self._sample_size <= <NUM_LIT:0> or self._n_rows <= <NUM_LIT:0>):<EOL><INDENT>raise StatsError("<STR_LIT>")<EOL><DEDENT>for col_name, col_type in schema:<EOL><INDENT>self._stats[col_name] = StatSet(self, col_name, col_type, n_rows,<EOL>distribution=self._distribution,<EOL>descriptive=self._descriptive,<EOL>sample_values=self._sample_values)<EOL><DEDENT>self._func, self._func_code = self.build()<EOL>
:param source: Source iterator. Must return dict-like rows.
:param schema:
:param distribution: If True, generate distribution stats: histogram, skewness, kurtosis
:param descriptive: If True, generate descriptive stats: mean, std, min, max, quartiles.
:param n_rows: An estimate of the number of rows in the datasets, for sampling
:param sample_size: Number of rows to sample.