From cc823e44edc8935248e3d9058e71ea71eea2cccb Mon Sep 17 00:00:00 2001 From: moshferatu Date: Tue, 7 Jan 2025 09:27:39 -0800 Subject: [PATCH] Import numpy's where() method directly instead of importing the entire numpy module --- strategies/five_period_rsi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/strategies/five_period_rsi.py b/strategies/five_period_rsi.py index cd44776..be002e5 100644 --- a/strategies/five_period_rsi.py +++ b/strategies/five_period_rsi.py @@ -1,4 +1,4 @@ -import numpy as np +from numpy import where from pandas import DataFrame, Series from indicators import rsi @@ -11,5 +11,5 @@ def five_period_rsi(data: DataFrame) -> Series: rsi_5 = rsi(data, period = 5) rsi_below_35 = rsi_5 < 35 - signals = np.where(rsi_below_35, 'L', 'N') + signals = where(rsi_below_35, 'L', 'N') return Series(signals, index = data.index) \ No newline at end of file