hse-python-assistant/app/utils/preprocess.py

9 lines
425 B
Python

import pandas as pd
def preprocess_test(test_solutions_path: str, test_tasks_path: str, save_path: str) -> None:
solutions_df = pd.read_excel(test_solutions_path)
tasks_df = pd.read_excel(test_tasks_path)
preprocessed_df = solutions_df.merge(tasks_df[['id', 'description']], left_on='task_id', right_on='id', how='left')
preprocessed_df[['description', 'student_solution']].to_excel(save_path, index=False)