Project Details

Union.py funtion union()

November 8th 2023

"Two text files separated by '|', containing data from COLSANITAS and MEDISANITAS, respectively, are read. The data is stored in two DataFrames, 'frame' and 'frame2', using Pandas' 'pd.read_csv' function. The '|' separator is specified and all columns in the file are included using the 'usecols=range(0, 59)' parameter. 'low_memory=False' is used to avoid memory-related warnings. It combines the two DataFrames into a single one called 'frame_final' using Pandas' '_append' method. This vertically joins the two DataFrames. The combined DataFrame 'frame_final' is converted to an Excel file using Pandas' 'to_excel' method. The file is saved in the specified path with the name (""Union.xlsx"") with the sheet name 'Sheet1' and without including the row index in the Excel file ('index=None' parameter). 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

Union.py funtion union()