Project Details

macros2.py funtion asignprocesoDiasJuntas()

September 1st 2023

"The dynamic path ruta_pend4 is set for the ""Pendientes4.xlsx"" file, which will be located in the output folder corresponding to the current day within the project folder structure. The slope file ""Pendientes4.xlsx"" is read into a DataFrame called df_pend4 using the 'openpyxl' engine. A new column called ""Assignment Per Process"" is inserted into the DataFrame df_pend4. This column is inserted after the ""Bogotá Process Assignment"" column. The rows in the DataFrame df_pend4 are iterated to determine the allocation per process. If the value in the 'PENDING/BOARDING/AHC' column is 'AHC', 'AHC' is added to the value in the 'Process Assignment' column; otherwise, the existing value in the 'Bogotá Process Assignment' column is preserved. A new column called ""Days Together"" is inserted into the DataFrame df_pend4. This column is inserted after the ""Assignment By Process"" column. Another iteration is performed on the rows of the DataFrame df_pend4 to determine the number of elapsed days. Depending on the value of the 'Days' column, a category is assigned to the 'Days Together' column ('0-5 days', '6-10 days', '11-15 days' or 'Greater than 15 days'). The ""Pendientes4.xlsx"" file is updated with the changes made to the DataFrame df_pend4. Finally, the function returns a value of 2 if executed successfully. Otherwise, it returns the error line along with an explanatory message of the error." library: sys, pandas, datetime, os, openpyxl

macros2.py funtion asignprocesoDiasJuntas()