Skip to content

Commit a10c1a6

Browse files
committed
Fix tests
1 parent 7beeeb8 commit a10c1a6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pyindicators/indicators/adx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import pandas as pd
88

99
from pyindicators.exceptions import PyIndicatorException
10-
from pyindicators.utils import pad_zero_values_pandas
10+
from pyindicators.indicators.utils import pad_zero_values_pandas
1111

1212

1313
def polars_ewm_mean_via_pandas(column: pl.Series, alpha: float) -> pl.Series:

pyindicators/indicators/crossover.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ def crossover(
5656
else:
5757
crossover_mask = (col1 > col2) & (prev_col1 <= prev_col2)
5858

59-
data[result_column] = crossover_mask.astype(int)
59+
data = data.copy()
60+
data.loc[:, result_column] = crossover_mask.astype(int)
6061

6162
# Polars Implementation
6263
elif isinstance(data, PlDataFrame):
@@ -69,6 +70,7 @@ def crossover(
6970
crossover_mask = (col1 > col2) & (prev_col1 <= prev_col2)
7071

7172
# Convert boolean mask to 1s and 0s
73+
data = data.clone()
7274
data = data.with_columns(pl.when(crossover_mask).then(1)
7375
.otherwise(0).alias(result_column))
7476

0 commit comments

Comments
 (0)