From c1ad2589da6e523630f5e18696c6499956c223f2 Mon Sep 17 00:00:00 2001 From: Tejasweee Date: Sun, 31 Dec 2023 09:29:19 +0545 Subject: [PATCH] make nan as float --- yfinance/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yfinance/base.py b/yfinance/base.py index 2741c1108..1d588b82d 100644 --- a/yfinance/base.py +++ b/yfinance/base.py @@ -2167,7 +2167,7 @@ def get_earnings_dates(self, limit=12, proxy=None) -> Optional[pd.DataFrame]: # Convert types for cn in ["EPS Estimate", "Reported EPS", "Surprise(%)"]: - dates.loc[dates[cn] == '-', cn] = "NaN" + dates.loc[dates[cn] == '-', cn] = float("nan") dates[cn] = dates[cn].astype(float) # Convert % to range 0->1: