Skip to content
Snippets Groups Projects
Commit a8db6c86 authored by Maël Madon's avatar Maël Madon
Browse files

use job_id as index in the panda dataframes

parent 6acf5bf4
Branches
No related tags found
No related merge requests found
......@@ -21,8 +21,9 @@ def clean_and_select(df):
select.job_id = select.job_id.astype(str)
select["job_id"] = select["job_id"].str.split(':', expand=True)[0]
select.job_id = select.job_id.astype(int)
select.sort_values(by="job_id")
return select.sort_values(by="job_id")
return select.set_index("job_id")
def open_and_compare(file1, file2):
......@@ -35,7 +36,7 @@ def open_and_compare(file1, file2):
out1 = clean_and_select(out1)
out2 = clean_and_select(out2)
if not out1.job_id.equals(out2.job_id):
if not out1.index.equals(out2.index):
raise KeyError(
f"{file1} and {file2} cannot be compared: they don't have the same job_ids")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment