def _normalize_inputs(self, xi):
"""Normalize the inputs."""
xi = np.asarray(xi, dtype=float)
if xi.shape[-1] != self.ndim:
raise ValueError("The requested sample points xi have dimension %d, "
"but this interpolator has dimension %d" % (xi.shape[-1], self.ndim))
xi = np.atleast_2d(xi.copy())
for idx, (offset, scale) in enumerate(self._scale_list):
xi[..., idx] -= offset
xi[..., idx] /= scale
# take extension input account.
xi += self._ext
return xi
评论列表
文章目录