integrate_column

typhon.math.integrate_column(y, x=None, axis=0)[source]

Integrate array along an arbitrary axis.

Note

This function is just a wrapper for numpy.trapz().

Parameters:
  • y (ndarray) – Data array.

  • x (ndarray) – Coordinate array.

  • axis (int) – Axis to integrate along for multidimensional input.

Returns:

Column integral.

Return type:

float or ndarray

Examples

>>> import numpy as np
>>> x = np.linspace(0, 1, 5)
>>> y = np.arange(5)
>>> integrate_column(y)
8.0
>>> integrate_column(y, x)
2.0