Explaination:
import numpy as np
np.zeros(the amount of arrays, amount of rows, the amount of colums)
---------------------------------------------------------------------
Usage:
array_city = np.zeros((2, 3, 4))
print(array_city)
---------------------------------------------------------------------
Results:
[
[
[0. 0. 0. 0.],
[0. 0. 0. 0.],
[0. 0. 0. 0.],
],
[
[0. 0. 0. 0.],
[0. 0. 0. 0.],
[0. 0. 0. 0.],
]
]
import pprint # importing pretty printed
def ThreeD(a, b, c):
lst = [[ ['#' for values in range(a)] for col in range(b)] for row in range(c)]
return lst
values= 5
col = 3
row = 2
# used the pretty printed function
pprint.pprint(ThreeD(values, col, row))
""" OUTPUT
[[['#', '#', '#', '#', '#'],
['#', '#', '#', '#', '#'],
['#', '#', '#', '#', '#']],
[['#', '#', '#', '#', '#'],
['#', '#', '#', '#', '#'],
['#', '#', '#', '#', '#']]]
"""