spkit
.fill_nans_1d¶
- spkit.fill_nans_1d(x, pkind='linear')¶
Fill nan values with interpolation/exterpolation for 1D
Fill nan values with interpolation/exterpolation for 1D
- Parameters:
- x1d array,
array with missing values as NaN
- pkindkind of interpolation, default=’linear
one of {‘linear’, ‘nearest’, ‘nearest-up’, ‘zero’, ‘slinear’, ‘quadratic’, ‘cubic’, ‘previous’, or ‘next’. ‘zero’}
- Returns:
- y1d array resulting array with interpolated values instead of nans
same shape-size as x
See also
Examples
>>> import numpy as np >>> import spkit as sp >>> x = np.array([1,1,np.nan, 3,4,9,3, np.nan]) >>> y = sp.fill_nans_1d(x) >>> y
array([ 1., 1., 2., 3., 4., 9., 3., -3.])
Examples using spkit.fill_nans_1d
¶
Release Highlights for spkit 0.0.9.7
Release Highlights for spkit 0.0.9.7