You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an issue in the _run method of the trend.py file of the ta package where the self._psar Series is accessed incorrectly.
Most of the indexing operations use .iloc[i], but at line 1030, the code uses self._psar[i] instead of self._psar.iloc[i], which can lead to unintended behavior.
Description
There is an issue in the
_run
method of thetrend.py
file of the ta package where theself._psar
Series is accessed incorrectly.Most of the indexing operations use
.iloc[i]
, but at line 1030, the code usesself._psar[i]
instead ofself._psar.iloc[i]
, which can lead to unintended behavior.Code Reference
The problematic line in
trend.py
:The first assignment should use
.iloc[i]
instead of direct indexing (self._psar[i]
).Steps to Reproduce
self._psar
is a Pandas Series, attempting to access it viaself._psar[i]
instead ofself._psar.iloc[i]
can cause index mismatches or errors.Expected Behavior
The indexing should be done consistently throughout the
_run
method using.iloc[i]
.Proposed Fix
Modify line 1030 of
trend.py
from:to:
Environment
Additional Context
This change aligns with how indexing is handled in other parts of the
_run
method and ensures consistency when accessing Pandas Series.The text was updated successfully, but these errors were encountered: