Skip to content

Commit 9f846c9

Browse files
authored
Fix: FutureWarning: The behavior of DataFrame.idxmin with all-NA values, or any-NA and ski pna=False, is deprecated. In a future version this will raise ValueError
1 parent 25c303e commit 9f846c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/barrier_method/barrier_method.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def _identify_barrier_hit(self, barrier: pd.DataFrame) -> pd.Series:
124124
"""
125125
# .idxmin() returns np.nan if no barriers have been hit
126126
# => .fillna(0) labels the "no barrier hit" condition
127-
barrier = barrier.idxmin(axis=1).fillna(0).astype(int)
127+
barrier = barrier.idxmin(axis=1, skipna=True).fillna(0).astype(int)
128128
# Correct for a possible look-ahead-bias & errors introduced by .fillna()
129129
barrier.iloc[-self.n:] = np.nan
130130
return barrier

0 commit comments

Comments
 (0)