So I have a very rudimentary understanding of python (10-week summer course split up between python and Matlab). I am trying to create a 2d list like so:
data.append (samples)
data.append (matches)
data_list.append (data)
data.clear()
This is running in a for loop and writing each time it iterates. However, when I run it and I print(data_list)
I get an empty list.
I have successfully ran it like so:
data.append (samples)
data.append (matches)
data_list.append (data)
data = []
But I do not understand the difference between my two methods and why only the second one works...