Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Allow crossed() methods with np.integer types #160

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

xmatthias
Copy link

@xmatthias xmatthias commented Aug 26, 2020

Fixes bad behaviour when passing in a np.integer type instead of a regular integer
crossed_above(series, 25) does work, while crossed_above(series, np.int64(25)) does not work.

Obviously, np.floating uses the same, but for floating point operators.

On it's own, this is not a problem as you can pick how to create the integer, however, it can become a problem depending where the 2nd variable came from, for example if it comes from a ml library

Fixes bad behaviour when passing in a np.integer type instead of a regular integer
`crossed_above(series, 25)` does work, while `crossed_above(series, np.int64(25))` does not work.

On it's own, this is not a problem, however, it can become a problem depending where the 2nd variable came from.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant