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 77import pandas as pd
88
99from 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
1313def 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(
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
You can’t perform that action at this time.
0 commit comments