mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-15 12:03:42 +02:00
fix: json format detection in deserialization of pandas dataframe made
more general and less dependant on the json implementation.
This commit is contained in:
parent
cc9f47c686
commit
dc45894b64
1 changed files with 1 additions and 1 deletions
|
@ -104,7 +104,7 @@ def deserialize_df(df, auto_gamma=False):
|
||||||
if df[column][0].startswith(b"\x1f\x8b\x08\x00"):
|
if df[column][0].startswith(b"\x1f\x8b\x08\x00"):
|
||||||
df[column] = df[column].transform(lambda x: gzip.decompress(x).decode('utf-8'))
|
df[column] = df[column].transform(lambda x: gzip.decompress(x).decode('utf-8'))
|
||||||
if isinstance(df[column][0], str):
|
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))
|
df[column] = df[column].transform(lambda x: import_json_string(x, verbose=False))
|
||||||
if auto_gamma is True:
|
if auto_gamma is True:
|
||||||
df[column].apply(lambda x: x.gamma_method())
|
df[column].apply(lambda x: x.gamma_method())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue