Skip to content

Commit

Permalink
fix: include NAs and not only NaNs.
Browse files Browse the repository at this point in the history
  • Loading branch information
pekasen committed Dec 5, 2024
1 parent a8931d9 commit 711fc0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spiderexpress/strategies/spikyball.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def calc_norm(source: pd.Series, edge: pd.Series, target: pd.Series) -> float:
float : the normalization constant
"""
if any([source.hasnans, edge.hasnans, target.hasnans]):
if any([source.isna().any(), edge.isna().any(), target.isna().any()]):
log.warning("Input contains NaN values which will be replaced with 1.")
norm_const = (source.fillna(1) * edge.fillna(1) * target.fillna(1)).fillna(1).sum()
return norm_const
Expand Down

0 comments on commit 711fc0d

Please sign in to comment.