We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
interp1d
Example:
x = sc.linspace(dim='x', start=0.1, stop=1.4, num=4, unit='rad') da = sc.DataArray(sc.sin(x), coords={'x': x}) from scipp.scipy.interpolate import interp1d f = interp1d(da, 'x') xnew = sc.scalar(0.333, unit='rad') f(xnew)
raises
File ~/code/scipp/install/scipp/scipy/interpolate/__init__.py:188, in interp1d.<locals>.func(xnew, midpoints) 182 if xnew.unit != da.coords[dim].unit: 183 raise UnitError( 184 f"Unit of interpolation points '{xnew.unit}' does not match unit " 185 f"'{da.coords[dim].unit}' of points defining the interpolation " 186 "function along dimension '{dim}'." 187 ) --> 188 if xnew.dim != dim: 189 raise DimensionError( 190 f"Dimension of interpolation points '{xnew.dim}' does not match " 191 f"interpolation dimension '{dim}'" 192 ) 193 f = inter.interp1d( 194 x=_as_interpolation_type(da.coords[dim].values), 195 y=da.values, (...) 198 **kwargs, 199 ) DimensionError: Expected 1 dimensions, got 0
It would be nice if we could also send a single value and get a scalar back.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Example:
raises
It would be nice if we could also send a single value and get a scalar back.
The text was updated successfully, but these errors were encountered: