From 18c277053c1b196876792b22ca4c80e4211ecb35 Mon Sep 17 00:00:00 2001 From: Quan Pham Date: Fri, 29 Mar 2024 16:35:46 -0400 Subject: [PATCH] Added ability to group invoices by PIs --- process_report/process_report.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/process_report/process_report.py b/process_report/process_report.py index 557ab03..cfcdc70 100644 --- a/process_report/process_report.py +++ b/process_report/process_report.py @@ -119,12 +119,12 @@ def export_pi_billables(dataframe: pandas.DataFrame, output_folder): if not os.path.exists(output_folder): os.mkdir(output_folder) - invoice_month = dataframe['Invoice Month'][0] + invoice_month = dataframe['Invoice Month'].iat[0] pi_list = dataframe['Manager (PI)'].unique() for pi in pi_list: pi_projects = dataframe[dataframe['Manager (PI)'] == pi] - pi_instituition = pi_projects['Institution'].unique()[0] + pi_instituition = pi_projects['Institution'].iat[0] pi_projects.to_csv(output_folder + f"/{pi_instituition}_{pi}_{invoice_month}.csv")