Project Details

macros2.py funtion filtroBogota()

August 16th 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. The path to read the ""Sheet3"" sheet from the ""NATIONWIDE 5.0 MODIFICADA1.xlsx SLOPE Plantilla_ESTADO"" file is defined and read into a DataFrame called df_H3. A new column called ""Filter to Map Bogota"" is inserted into the DataFrame df_pend4. This column is inserted after the ""Assignment"" column. The cond1 and cond2 conditions are defined and will be used to filter the rows in the DataFrame df_pend4. Filtering logic is applied using the cond1 and cond2 conditions to assign values to the ""Bogota Filter to Map"" column in the DataFrame df_pend4. A new column called ""Bogota Filter #2"" is inserted into the DataFrame df_pend4. This column is inserted after the ""Filter to assign Bogota"" column. A cross-reference is made between the df_pend4 and df_H3 DataFrames, and the ""Bogotá Filter #2"" column in df_pend4 is updated with the corresponding df_H3 values according to the established conditions. 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 filtroBogota()