def __array__(self):
import numpy  <EOL>compound_list = sorted(self._database.compounds)<EOL>reaction_list = sorted(self._database.reactions)<EOL>matrix = numpy.zeros((len(compound_list), len(reaction_list)))<EOL>compound_map = dict(<EOL>(compound, i) for i, compound in enumerate(compound_list))<EOL>reaction_map = dict(<EOL>(reaction_id, i) for i, reaction_id in enumerate(reaction_list))<EOL>for reaction_id in self._database.reactions:<EOL><INDENT>for compound, value in self._database.get_reaction_values(<EOL>reaction_id):<EOL><INDENT>c_index = compound_map[compound]<EOL>r_index = reaction_map[reaction_id]<EOL>matrix[c_index, r_index] = value<EOL><DEDENT><DEDENT>return matrix<EOL>
Return Numpy ndarray instance of matrix.

        The matrix is indexed by sorted compound, reaction-keys