#NEWLINE# def cumulative_integral( fx , x ) : #NEWLINE# #INDENT# '\n    Return the cumulative integral of arrays, initial value is 0.\n\n    Parameters:\n\n        fx: (n,d) numpy array, what you want to integral of\n        x: (n,) numpy array, location to integrate over.\n    ' #NEWLINE# return cumtrapz ( fx . T , x , initial = 0 ) . T