gfuncpy.grid_function module

class gfuncpy.grid_function.Grid(x)[source]

Bases: object

property diff
property x
class gfuncpy.grid_function.GridFunction(x=None, y=None)[source]

Bases: object

Assuming x is sorted and y is in the corresponding order

d()

Return a new GridFunction containing the derivative computed using the weighted central difference operator (handles non-uniform grids).

Endpoints where a central difference cannot be formed will be NaN.

derivative()[source]

Return a new GridFunction containing the derivative computed using the weighted central difference operator (handles non-uniform grids).

Endpoints where a central difference cannot be formed will be NaN.

classmethod from_dataframe(df, y, x=None)[source]

must specify y (a column name) if x is not specified will use index of the DataFrame

classmethod from_series(ss)[source]
int(frm=None, to=None)

Compute the integral of the function using the trapezoidal rule.

integrate(frm=None, to=None)[source]

Compute the integral of the function using the trapezoidal rule.

maximum(other)[source]
minimum(other)[source]
plot(style='-', label=None)[source]
root()[source]

Linear search from the left until the first root is found, slow but convenient API.

property x
class gfuncpy.grid_function.Identity(nodes, n=None)[source]

Bases: GridFunction

classmethod uniform_grid(a, b, n)[source]
gfuncpy.grid_function.gfunc(func)[source]
gfuncpy.grid_function.max(f1, f2)[source]
gfuncpy.grid_function.min(f1, f2)[source]