From dc45894b644a3e85fa81d1de1b11b14fadce13dd Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Mon, 4 Jul 2022 14:47:01 +0100 Subject: [PATCH] fix: json format detection in deserialization of pandas dataframe made more general and less dependant on the json implementation. --- pyerrors/input/pandas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyerrors/input/pandas.py b/pyerrors/input/pandas.py index 24296781..867554ae 100644 --- a/pyerrors/input/pandas.py +++ b/pyerrors/input/pandas.py @@ -104,7 +104,7 @@ def deserialize_df(df, auto_gamma=False): if df[column][0].startswith(b"\x1f\x8b\x08\x00"): df[column] = df[column].transform(lambda x: gzip.decompress(x).decode('utf-8')) if isinstance(df[column][0], str): - if df[column][0][:20] == '{"program":"pyerrors': + if '"program":' in df[column][0][:20]: df[column] = df[column].transform(lambda x: import_json_string(x, verbose=False)) if auto_gamma is True: df[column].apply(lambda x: x.gamma_method())