Skip to content

BUG: OLS.predict() fails when given a Series #5233

Closed
@rockg

Description

@rockg

OLS.predict() makes a call to dropna() with an argument when Series has no such argument. I believe the fix here is to just move the DataFrame creation above the "if fill_value" clause.

            orig_x = x
            if fill_value is None and fill_method is None:
                x = x.dropna(how='any')
            else:
                x = x.fillna(value=fill_value, method=fill_method, axis=axis)
            if isinstance(x, Series):
                x = DataFrame({'x': x})
            if self._intercept:
                x['intercept'] = 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions