mirror of
https://github.com/TauricResearch/TradingAgents.git
synced 2026-09-27 23:12:39 +03:00
fix(yahoo): clean OHLCV frames on their own copy
- dropping undated rows copies the frame before prices are coerced, so no chained-assignment write
This commit is contained in:
+1
-1
@@ -105,7 +105,7 @@ def _clean_dataframe(data: pd.DataFrame) -> pd.DataFrame:
|
||||
the latest in-range bar (#1201)."""
|
||||
data = _ensure_date_column(data)
|
||||
data["Date"] = _normalize_dates(data["Date"])
|
||||
data = data.dropna(subset=["Date"])
|
||||
data = data.dropna(subset=["Date"]).copy()
|
||||
|
||||
price_cols = [c for c in ["Open", "High", "Low", "Close", "Volume"] if c in data.columns]
|
||||
data[price_cols] = data[price_cols].apply(pd.to_numeric, errors="coerce")
|
||||
|
||||
Reference in New Issue
Block a user