From ea2d292561d940378eb155ffdcaa11d06d0e8b0a Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Fri, 13 Oct 2023 13:08:38 -0600 Subject: fix reading NA as NaN --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main.py') diff --git a/main.py b/main.py index c1f47cc..ff63485 100644 --- a/main.py +++ b/main.py @@ -172,7 +172,7 @@ class CompanySelector: with open(path.join(user_data_dir(appname, appauthor), "default.txt"), "w") as f: f.write(file_path) try: - self.df = pd.read_excel(file_path) + self.df = pd.read_excel(file_path, keep_default_na=False) self.df = self.df[self.df['Company Name'].notna()] self.df = self.df[self.df['Symbol'].notna()] except Exception as e: @@ -188,7 +188,7 @@ class CompanySelector: with open(path.join(user_data_dir(appname, appauthor), "default.txt")) as f: try: fname = f.read() - self.df = pd.read_excel(fname) + self.df = pd.read_excel(fname, keep_default_na=False) self.df = self.df[self.df['Company Name'].notna()] self.df = self.df[self.df['Symbol'].notna()] except Exception as e: -- cgit v1.2.3