Skip to content

Display the correct error message when calling a binary moment without appropriate parameters. #5399

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

Merged
1 commit merged into from
Nov 21, 2013
Merged

Display the correct error message when calling a binary moment without appropriate parameters. #5399

1 commit merged into from
Nov 21, 2013

Conversation

tr11
Copy link
Contributor

@tr11 tr11 commented Oct 31, 2013

This pr fixes a typo in the type checking of binary moments. It makes the error messages below consistent:

import pandas
a = pandas.DataFrame([1,2,3,4,5,6])
pandas.rolling_cov(list(), a, 3)
ValueError: arguments to moment function must be of type ndarray/DataFrame

pandas.rolling_cov(a, list(), 3)
TypeError: unsupported type: <type 'list'>

@jtratner
Copy link
Contributor

I'm not sure you have this right. Also should be TypeError not ValueError.
Please change and I'll review.

@ghost
Copy link

ghost commented Nov 21, 2013

This looks good. I'll push the exception type fix seperately.

e82c1f7

ghost pushed a commit that referenced this pull request Nov 21, 2013
Display the correct error message when calling a binary moment without appropriate parameters.
@ghost ghost merged commit 2b79656 into pandas-dev:master Nov 21, 2013
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants