9951 explained code solutions for 126 technologies


python-numpyCreate 3-dimensional array


import numpy as np
a = np.array([
  [ [1, 2, 3], [3, 4, 5], [2, 4, 6] ],
  [ [5, 6, 7], [7, 8, 9], [6, 7, 9] ],
  [ [3, 2, 1], [2, 4, 6], [1, 2, 3] ],
])ctrl + c
import numpy as np

load Numpy module for Python

np.array

declare Numpy array