− DATA_A = "2021Census_T24A_AUST_LGA.csv"
− DATA_B = "2021Census_T24B_AUST_LGA.csv"
− DATA_C = "2021Census_T24C_AUST_LGA.csv"
− DATA_D = "2021Census_T24D_AUST_LGA.csv"
+ DATA_A = "2021Census_T24A_AUST_STE.csv"
+ DATA_B = "2021Census_T24B_AUST_STE.csv"
+
+
+ # Merge files into list of unique cells
+ def merge_file_parts(filenames):
+ merged_file = []
+ for file_index in range(len(filenames)):
+ file = open(filenames[file_index], "r").readlines()
+ # Split the row into columns
+ for row in range(len(file)):
+ cols_in_row = file[row].split(",")
+
+ # Remove any newlines from cells
+ for column in range(len(cols_in_row)):
+ cols_in_row[column] = cols_in_row[column].strip()
+
+ file[row] = cols_in_row
+
+ # The FIRST file in the list (DATA_A)
+ if file_index == 0:
+ # `merged_file` is empty, this is the first file we are processing
+ merged_file = file
+ else:
+ for row in range(len(file)):
+ # Extend with everything in row except state codes
+ merged_file[row].extend(file[row][1:])
+
+ return merged_file