Skip to content
Snippets Groups Projects
Commit a2e27eaf authored by Millian Poquet's avatar Millian Poquet
Browse files

script: join job prediction & job infos

parent 82cb8f0f
Branches
No related tags found
No related merge requests found
......@@ -53,3 +53,8 @@ nix develop .#use-python-scripts --command m100-agg-danilo-estimations danilo-du
```sh
nix develop .#use-python-scripts --command m100-agg-jobs-info ./m100-data/ ./m100-data/22-jobs.csv 22-01 22-02 22-03 22-04 22-05 22-06 22-07 22-08 22-09
```
## merge power estimations with job informations into a single file
```sh
nix develop .#use-python-scripts --command m100-join-usable-jobs-info ./m100-data/22-job-power-estimations.csv ./m100-data/22-jobs.csv ./m100-data/22-jobs-with-prediction.csv
```
#!/usr/bin/env python3
import argparse
import csv
import os
import pandas as pd
def join():
parser = argparse.ArgumentParser()
parser.add_argument("input_prediction_csv_file", help='filepath to the job power prediction file')
parser.add_argument("input_jobs_info_csv_file", help='filepath to the job information file')
parser.add_argument("output_file", help="where to write the result CSV file")
args = parser.parse_args()
prediction_df = pd.read_csv(args.input_prediction_csv_file)
jobs_info_df = pd.read_csv(args.input_jobs_info_csv_file)
prediction_df.merge(jobs_info_df, how='left').to_csv(args.output_file, index=False, quoting=csv.QUOTE_NONNUMERIC)
......@@ -12,3 +12,4 @@ m100-data-downloader = "expe_energumen.m100_data_downloader:main"
m100-agg-power-months = "expe_energumen.m100_agg_month_power_values:several_months"
m100-agg-danilo-estimations = "expe_energumen.m100_agg_danilo_estimations:agg_all_files"
m100-agg-jobs-info = "expe_energumen.m100_agg_jobs_info:several_months"
m100-join-usable-jobs-info = "expe_energumen.m100_join_usable_jobs_info:join"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment