def fill_graph(graph, array):
import ROOT<EOL>array = np.asarray(array, dtype=np.double)<EOL>if isinstance(graph, ROOT.TGraph):<EOL><INDENT>if array.ndim != <NUM_LIT:2>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if array.shape[<NUM_LIT:1>] != <NUM_LIT:2>:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>return _librootnumpy.fill_g1(<EOL>ROOT.AsCObject(graph), array)<EOL><DEDENT>elif isinstance(graph, ROOT.TGraph2D):<EOL><INDENT>if array.ndim != <NUM_LIT:2>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if array.shape[<NUM_LIT:1>] != <NUM_LIT:3>:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>return _librootnumpy.fill_g2(<EOL>ROOT.AsCObject(graph), array)<EOL><DEDENT>else:<EOL><INDENT>raise TypeError(<EOL>"<STR_LIT>")<EOL><DEDENT>
Fill a ROOT graph with a NumPy array.

    Parameters
    ----------
    graph : a ROOT TGraph or TGraph2D
        The ROOT graph to fill.
    array : numpy array of shape [n_samples, n_dimensions]
        The values to fill the graph with. The number of columns must match the
        dimensionality of the graph.