import numpy as np r = np.array([ [1, 2, 3, 4], [5, 6, 7, 8], ]) g = np.array([ ['a', 'b', 'c', 'd'], ['e', 'f', 'g', 'h'], ]) b = np.array([ ['A', 'B', 'C', 'D'], ['E', 'F', 'G', 'H'], ]) # složme 3 2D-pole do jednoho 3D-pole rgb_1 = np.stack((r, g, b), axis=0) rgb_2 = np.stack((r, g, b), axis=1) rgb_3 = np.stack((r, g, b), axis=2) # vzhled a vlastnosti polí print('\n\n rgb_1:') print(rgb_1) print(rgb_1.shape, rgb_1.ndim) print('\n\n rgb_2:') print(rgb_2) print(rgb_2.shape, rgb_2.ndim) print('\n\n rgb_3:') print(rgb_3) print(rgb_3.shape, rgb_3.ndim)