Spaces:
Running
Running
revised to correct the outlier report errors
Browse files
app.py
CHANGED
|
@@ -116,7 +116,7 @@ def clean_data_and_report_outliers(df):
|
|
| 116 |
outlier_report = []
|
| 117 |
price_columns = [col for col in df.columns if '_volume' not in str(col).lower()]
|
| 118 |
for ticker in price_columns:
|
| 119 |
-
numeric_prices = pd.to_numeric(df[ticker], errors='coerce')
|
| 120 |
daily_pct_change = numeric_prices.pct_change().abs()
|
| 121 |
outlier_days = daily_pct_change[daily_pct_change > 1.0].index
|
| 122 |
if not outlier_days.empty:
|
|
|
|
| 116 |
outlier_report = []
|
| 117 |
price_columns = [col for col in df.columns if '_volume' not in str(col).lower()]
|
| 118 |
for ticker in price_columns:
|
| 119 |
+
numeric_prices = pd.to_numeric(df[ticker], errors='coerce').replace(0, np.nan)
|
| 120 |
daily_pct_change = numeric_prices.pct_change().abs()
|
| 121 |
outlier_days = daily_pct_change[daily_pct_change > 1.0].index
|
| 122 |
if not outlier_days.empty:
|