def microcanonical_averages_arrays(microcanonical_averages):
ret = dict()<EOL>for n, microcanonical_average in enumerate(microcanonical_averages):<EOL><INDENT>assert n == microcanonical_average['<STR_LIT:n>']<EOL>if n == <NUM_LIT:0>:<EOL><INDENT>num_edges = microcanonical_average['<STR_LIT:M>']<EOL>num_sites = microcanonical_average['<STR_LIT:N>']<EOL>spanning_cluster = ('<STR_LIT>' in microcanonical_average)<EOL>ret['<STR_LIT>'] = np.empty(num_edges + <NUM_LIT:1>)<EOL>ret['<STR_LIT>'] = np.empty((num_edges + <NUM_LIT:1>, <NUM_LIT:2>))<EOL>if spanning_cluster:<EOL><INDENT>ret['<STR_LIT>'] = np.empty(num_edges + <NUM_LIT:1>)<EOL>ret['<STR_LIT>'] = np.empty((num_edges + <NUM_LIT:1>, <NUM_LIT:2>))<EOL><DEDENT>ret['<STR_LIT>'] = np.empty((<NUM_LIT:5>, num_edges + <NUM_LIT:1>))<EOL>ret['<STR_LIT>'] = np.empty((<NUM_LIT:5>, num_edges + <NUM_LIT:1>, <NUM_LIT:2>))<EOL><DEDENT>ret['<STR_LIT>'][n] = microcanonical_average['<STR_LIT>']<EOL>ret['<STR_LIT>'][n] = (<EOL>microcanonical_average['<STR_LIT>']<EOL>)<EOL>if spanning_cluster:<EOL><INDENT>ret['<STR_LIT>'][n] = (<EOL>microcanonical_average['<STR_LIT>']<EOL>)<EOL>ret['<STR_LIT>'][n] = (<EOL>microcanonical_average['<STR_LIT>']<EOL>)<EOL><DEDENT>ret['<STR_LIT>'][:, n] = microcanonical_average['<STR_LIT>']<EOL>ret['<STR_LIT>'][:, n] = microcanonical_average['<STR_LIT>']<EOL><DEDENT>for key in ret:<EOL><INDENT>if '<STR_LIT>' in key:<EOL><INDENT>continue<EOL><DEDENT>ret[key] /= num_sites<EOL><DEDENT>ret['<STR_LIT:M>'] = num_edges<EOL>ret['<STR_LIT:N>'] = num_sites<EOL>return ret<EOL>
Compile microcanonical averages over all iteration steps into single arrays

Helper function to aggregate the microcanonical averages over all iteration
steps into single arrays for further processing

Parameters
----------

microcanonical_averages : iterable
   Typically, this is the :func:`microcanonical_averages` generator

Returns
-------

ret : dict
   Aggregated cluster statistics

ret['N'] : int
    Total number of sites

ret['M'] : int
    Total number of bonds

ret['spanning_cluster'] : 1-D :py:class:`numpy.ndarray` of float
    The percolation probability:
    The normalized average number of runs that have a spanning cluster.

ret['spanning_cluster_ci'] : 2-D :py:class:`numpy.ndarray` of float, size 2
    The lower and upper bounds of the percolation probability.

ret['max_cluster_size'] : 1-D :py:class:`numpy.ndarray` of float
    The percolation strength:
    Average relative size of the largest cluster

ret['max_cluster_size_ci'] : 2-D :py:class:`numpy.ndarray` of float
    Lower and upper bounds of the normal confidence interval of the
    percolation strength.

ret['moments'] : 2-D :py:class:`numpy.ndarray` of float, shape (5, M + 1)
    Average raw moments of the (relative) cluster size distribution.

ret['moments_ci'] : 3-D :py:class:`numpy.ndarray` of float, shape (5, M + 1, 2)
    Lower and upper bounds of the normal confidence interval of the raw
    moments of the (relative) cluster size distribution.

See Also
--------

microcanonical_averages