"src/vscode:/vscode.git/clone" did not exist on "631e0a2a7bdd694a91f30378fb271d05ce438122"
Commit 7577a363 authored by Guolin Ke's avatar Guolin Ke Committed by GitHub
Browse files

fix _load_pandas_categorical

parent 95519f36
......@@ -282,7 +282,10 @@ def _save_pandas_categorical(file_name, pandas_categorical):
def _load_pandas_categorical(file_name):
with open(file_name, 'r') as f:
last_line = f.readlines()[-1]
lines = f.readlines()
last_line = lines[-1]
if last_line.strip() == "":
last_line = lines[-2]
if last_line.startswith('pandas_categorical:'):
return json.loads(last_line[len('pandas_categorical:'):])
return None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment