I'm having difficulty with this issue, so I'll describe my problem.
I have a text file that contains 81 elements, but 1 column, i.e. it's a 81x1 matrix file.
The actual elements are irrelevant.
The file contains:
0
0
0
0
-1
.
.
.
How do I read it into a 9x9 matrix list?
For every 9th element, I want to move the next element into another column, to achieve a 9x9 matrix list.
So far I have this:
rewards = []
zero_list = ["0", "0", "0", "0", "0", "0", "0", "0", "0"]
for index in range(len(zero_list)):
rewards.append(zero_list)
Now I have a 9x9 matrix containing all 0's.
But I'm not sure exactly how to go about storing the values in my rewards list.
Thanks!