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

FIX: OLS.predict() - cast input to DataFrame from Series before performing operations #5234

Closed
wants to merge 2 commits into from

Conversation

@rockg
Copy link
Contributor

commented Oct 15, 2013

Closes #5233. Simply cast to a Series to a DataFrame before dropping NAs or filling.

@jreback

This comment has been minimized.

Copy link
Contributor

commented Oct 15, 2013

can u add some tests that demonstrate the issue?

@jtratner

This comment has been minimized.

Copy link
Contributor

commented Oct 15, 2013

Frankly, I think the better fix (separate from this PR) would be to have Series' dropna match signature of DF and Panel, since both 'any' and 'all' or thresh apply. Just means that you don't have to care about what kind of NDFrame you have.

Please update your commit message to emphasize that it's only in OLS-Predict. I read the title and was quite confused.

@jreback jreback referenced this pull request Oct 16, 2013
1 of 7 tasks complete
@rockg

This comment has been minimized.

Copy link
Contributor Author

commented Oct 16, 2013

@jreback @jtratner Here is the issue demonstrated and I put this as a test in the last commit that now passes with the fix. I agree with @jtratner that series and dataframes should have the same drop arguments.

y = tm.makeTimeSeries()
x = tm.makeTimeSeries()
model = ols(y=y, x=x)
model.predict(x=x)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File ...ols.py, line 446, in predict
    x = x.dropna(how='any')
TypeError: dropna() got an unexpected keyword argument 'how'
@jtratner

This comment has been minimized.

Copy link
Contributor

commented Oct 17, 2013

looks fine to me.

@jreback

This comment has been minimized.

Copy link
Contributor

commented Oct 17, 2013

closing in favor of #5251 (credited for your tests!)

@rockg rockg deleted the rockg:patch-1 branch Mar 11, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.