“np.stack” Kode Jawaban

np.stack

arrays = [np.random.randn(3, 4) for _ in range(10)]
>>> np.stack(arrays, axis=0).shape
(10, 3, 4)
Jordach Makaya

np.stack

>>> a = np.array([1, 2, 3])
>>> b = np.array([2, 3, 4])
>>> np.stack((a, b))
array([[1, 2, 3],
       [2, 3, 4]])

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya