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

Optimize sliding window kurtosis #37

Closed
amaggi opened this issue Oct 16, 2012 · 1 comment
Closed

Optimize sliding window kurtosis #37

amaggi opened this issue Oct 16, 2012 · 1 comment

Comments

@amaggi
Copy link
Owner

amaggi commented Oct 16, 2012

Set up a 2D array where each row is a window, and send to ss.kurtosos . To set up sliding window, try following code:

def window(seq, n=2):
    "Returns a sliding window (of width n) over data from the iterable"
    "   s -> (s0,s1,...s[n-1]), (s1,s2,...,sn), ...                   "
    it = iter(seq)
    result = tuple(islice(it, n))
    if len(result) == n:
        yield result    
    for elem in it:
        result = result[1:] + (elem,)
        yield result
@amaggi
Copy link
Owner Author

amaggi commented Oct 16, 2012

Implemented in dev. Now test that sw_kurtosis1 and sw_kurtosis2 in filters give the same result.

@amaggi amaggi closed this as completed Oct 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant