Skip to content

pandas.stats.ols.MovingOLS._calc_betas incompatibility issue with newer numpy #8243

Closed
@wangshun98

Description

@wangshun98

numpy version 1.8.2
pandas version 0.14.1

In pandas/stats/ols.py:821, we have:
mask = -np.isnan(betas).any(axis=1)

This causes problem with newer numpy which deprecated negative unary operator (-) on boolean arrays. I got this following error when running into this line:
DeprecationWarning: numpy boolean negative (the unary - operator) is deprecated, use the bitwise_xor (the ^ operator) or the logical_xor function instead.

When I change "-" to "~", the problem goes away. It's minor, but hope we can incorporate this into next pandas update. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Compatpandas objects compatability with Numpy or Python functions

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions