File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 7
7
import pandas as pd
8
8
9
9
from pyindicators .exceptions import PyIndicatorException
10
- from pyindicators .utils import pad_zero_values_pandas
10
+ from pyindicators .indicators . utils import pad_zero_values_pandas
11
11
12
12
13
13
def polars_ewm_mean_via_pandas (column : pl .Series , alpha : float ) -> pl .Series :
Original file line number Diff line number Diff line change @@ -56,7 +56,8 @@ def crossover(
56
56
else :
57
57
crossover_mask = (col1 > col2 ) & (prev_col1 <= prev_col2 )
58
58
59
- data [result_column ] = crossover_mask .astype (int )
59
+ data = data .copy ()
60
+ data .loc [:, result_column ] = crossover_mask .astype (int )
60
61
61
62
# Polars Implementation
62
63
elif isinstance (data , PlDataFrame ):
@@ -69,6 +70,7 @@ def crossover(
69
70
crossover_mask = (col1 > col2 ) & (prev_col1 <= prev_col2 )
70
71
71
72
# Convert boolean mask to 1s and 0s
73
+ data = data .clone ()
72
74
data = data .with_columns (pl .when (crossover_mask ).then (1 )
73
75
.otherwise (0 ).alias (result_column ))
74
76
You can’t perform that action at this time.
0 commit comments