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

new tool for computing distance between two jobs.csv files

parent 2ce897a2
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
"""Compute a set of distances between two batsim outputs (_jobs.csv)"""
import pandas as pd
def clean_and_select(df):
"""Select only desired column from the dataframe and clean the job_ids"""
# Select
desired_cols = ["job_id", "submission_time", "starting_time", "finish_time"]
select = df.loc[:, desired_cols]
# Clean job_id
select.job_id = select.job_id.astype(str)
select["job_id"] = select["job_id"].str.split(':', expand=True)[0]
return select
def open_and_compare(file1, file2):
"""Open file1 and file2, two _jobs.csv files. Checks if the job_ids match
and return their pandas Dataframe representation"""
out1 = pd.read_csv(file1)
out2 = pd.read_csv(file2)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment