I am trying to build a 2-dimensial array which will be used to write values to a CSV file. At the point I am at, the array looks like
[['Filename', 'Date', 'Message']]
Those are the header rows. I need to be able to make a new 2D array which will have my new values placed in the correct indexes. For example,
my_list_of_csv_readings[index_row][0] = "file1.txt"
my_list_of_csv_readings[index_row][1] = "04/27/2021"
my_list_of_csv_readings[index_row][2] = "Hello World"
As you can see, I am just trying to add the values to the 2D array but assigning them to the indexes. The desired 2D array after inserting values would be:
[["Filename", "Date", "Message"], ["file1.txt", "04/27/2021", "New Message"]]
How can I ignore the fact that the index is out range and create a new list with the desired output?