In one dimension a "grid" would be an array of numbers between let's say 0 and 100. In two dimensions the grid would be an array of points like [0, 0] [0, 1] [0, 2]... [1,0], [1, 1] ... [99, 99]. In three dimensions and more dimensions it would look similar.
My current output is like that:
It doesn't create every combination of values for each value in the nth - 1 column.
The code I use is:
import numpy as np
class Cube:
side_len = 100
def __init__(self, n):
current_point = np.zeros(n)
self.arr = []
for i in range(n):
for j in range(Cube.side_len):
self.arr.append(current_point.copy())
current_point[i] += 1.0
self.arr.append([Cube.side_len for _ in range(n)])
self.arr = np.array(self.arr)
np.random.shuffle(self.arr)
if __name__ == '__main__':
cube(10)
I tried also with meshgrid but I could not understand the documentation. I wanted it to be a shallow list of points but I get X, Y and I don't get what I am supposed to do with that?