Data.interpolate¶
- Data.interpolate(newX, kind='linear', xcol=None, replace=False)¶
Interpolate a dataset to get a new set of values for a given set of x data.
- Parameters
ewX (1D array or None) – Row indices or X column values to interpolate with. If None, then the
AnalysisMixin.interpolate()
returns an interpolation function. Unlike the raw interpolation function from scipy, this interpolation function will work with MaskedArrays by compressing them first.- Keyword Arguments
kind (string) – Type of interpolation function to use - does a pass through from numpy. Default is linear.
xcol (index or None) – Column index or label that contains the data to use with newX to determine which rows to return. Defaults to None.
replace (bool) – If true, then the current AnalysisMixin’s data is replaced with the newly interpolated data and the current AnalysisMixin is returned.
- Returns
(2D numpy array) – Section of the current object’s data if replace is False(default) or the modofied AnalysisMixin if replace is true.
Note
Returns complete rows of data corresponding to the indices given in newX. if xcol is None, then newX is interpreted as (fractional) row indices. Otherwise, the column specified in xcol is thresholded with the values given in newX and the resultant row indices used to return the data.
If the positional argument, newX is None, then the return value is an interpolation function. This interpolation function takes one argument - if xcol was None, this argument is interpreted as array indices, but if xcol was specified, then this argument is interpreted as an array of xvalues.