Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

add a third dimension matrix dataset python


> a = np.ones((100, 100, 6))
> b = np.dstack([a, np.zeros([100, 100, 2])])
> b.shape
(100, 100, 8)
> b
array([[[1, 1, 1, ..., 1, 0, 0],
    [1, 1, 1, ..., 1, 0, 0],
    [1, 1, 1, ..., 1, 0, 0],
     ...

Source by coders911.org #
 
PREVIOUS NEXT
Tagged: #add #dimension #matrix #dataset #python
ADD COMMENT
Topic
Name
8+6 =