From f0966fbe211b7c13c738821de81afdc3a3fd7b38 Mon Sep 17 00:00:00 2001 From: Nico Matentzoglu Date: Fri, 8 Nov 2024 21:22:56 +0200 Subject: [PATCH] Update util.py --- src/sssom/util.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sssom/util.py b/src/sssom/util.py index ab8f0241..5d042374 100644 --- a/src/sssom/util.py +++ b/src/sssom/util.py @@ -168,8 +168,11 @@ def from_mapping_set_document(cls, doc: MappingSetDocument) -> "MappingSetDataFr # ! This will break when pandas >= 3.0.0 is released # https://github.com/pandas-dev/pandas/issues/57734 - if "future.no_silent_downcasting" in pd.options: + try: pd.set_option("future.no_silent_downcasting", True) + except KeyError: + # Option does not exist in this version of pandas + pass df.replace("", np.nan, inplace=True) df.dropna(axis=1, how="all", inplace=True) # remove columns with all row = 'None'-s.