Skip to content

Interp

interp

Interpolator

Bases: MojoBaseModel

Utility to handle 1D lookup tables for forcing functions.

x instance-attribute

Python
x: VecN

Interpolation abscissa values.

y instance-attribute

Python
y: VecN

Interpolation ordinate values

kind class-attribute instance-attribute

Python
kind: InterpOptions = 'linear'

What type of interpolation should be used.

from_series classmethod

Python
from_series(
    series: Series, kind: InterpOptions = "linear"
) -> Self

Create an interpolator directly from a Pandas Series.

Source code in src/mujoco_mojo/utils/interp.py
Python
@classmethod
def from_series(cls, series: pd.Series, kind: InterpOptions = "linear") -> Self:
    """Create an interpolator directly from a Pandas Series."""
    return cls(x=np.asarray(series.index), y=np.asarray(series.values), kind=kind)