From f7893f450e1ba539fe58b06f246db39ee2dc8fdf Mon Sep 17 00:00:00 2001 From: Tim Johann Date: Wed, 18 Jan 2023 17:39:29 +0100 Subject: [PATCH] data.py: rounding input data to 14 significant digits, to work around bug in SDV. See https://github.com/sdv-dev/SDV/issues/1039 --- ASyH/data.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ASyH/data.py b/ASyH/data.py index 72844c0..91cee38 100644 --- a/ASyH/data.py +++ b/ASyH/data.py @@ -42,9 +42,11 @@ def read(self, input_file): # generic read method inferring file format from 'm x = re.compile(".*Excel.*") c = re.compile(".*CSV.*") if x.match(filetype): - data = pandas.read_excel(input_file) + # rounding the input to work around + # https://github.com/sdv-dev/SDV/issues/1039 + data = pandas.read_excel(input_file).round(decimals=14) elif c.match(filetype): - data = pandas.read_csv(input_file) + data = pandas.read_csv(input_file).round(decimals=14) else: raise DataError("Cannot determine input file type: ") # the data contains a spurious index column when saved from pandas!