Skip to content
New issue

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

Add interpolation utility #349

Closed
jrleeman opened this issue Mar 17, 2017 · 0 comments
Closed

Add interpolation utility #349

jrleeman opened this issue Mar 17, 2017 · 0 comments
Assignees
Labels
Area: Calc Pertains to calculations Type: Feature New functionality
Milestone

Comments

@jrleeman
Copy link
Contributor

Add some form of interpolating NaNs like that proposed in #348

def interpolate_nans(x, y):
    """
    Interpolates nan values in y. Sorts if necessary.
    """
    x_sort_args = np.argsort(x)
    x = x[x_sort_args]
    y = y[x_sort_args]
    nans = np.isnan(y)
    y[nans]= np.interp(x[nans], x[~nans], y[~nans])
    return y[x_sort_args]
@jrleeman jrleeman added Area: Calc Pertains to calculations Type: Feature New functionality labels Mar 17, 2017
@dopplershift dopplershift modified the milestone: 0.5.0 Mar 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Calc Pertains to calculations Type: Feature New functionality
Projects
None yet
Development

No branches or pull requests

2 participants