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

rolling_corr not in [-1,1] when using 'center' flag #3155

Closed
iamlemec opened this issue Mar 24, 2013 · 3 comments
Closed

rolling_corr not in [-1,1] when using 'center' flag #3155

iamlemec opened this issue Mar 24, 2013 · 3 comments
Labels
Milestone

Comments

@iamlemec
Copy link
Contributor

The function rolling_corr returns values with absolute value greater than one when using the 'center' flag. The following code will reproduce (with high probability):

df = pandas.DataFrame(numpy.random.rand(30,2))
pandas.rolling_corr(df[0],df[1],5,center=True)

It seems like passing center to rolling_count and rolling_mean in rolling_corr would be in order?

Also, unrelated to this, calling rolling_corr(5,6,10) will hit the recursion limit because _flex_binary_moment keeps switching the first two arguments around.

@ghost
Copy link

ghost commented Mar 24, 2013

Thanks, we'll handle that along with #2953.

@ghost
Copy link

ghost commented Mar 26, 2013

#2953 tests for corr>1, and includes a fix.

@ghost
Copy link

ghost commented Mar 26, 2013

recursion error fixed in master via b6b6023
rolling_curr>1 issue via cd07f4b

@ghost ghost closed this as completed Mar 26, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant