NumPy Depth-Wise Splitting: numpy.dsplit() function

It is used to split an array into multiple sub-arrays along the 3rd axis i.e. dsplit() only works on arrays of 3-D or more dimensions.

Syntax:

numpy.dsplit(array, sections)

Example:

import numpy as np
a=np.array([[[1,2,3],[4,5,6]],[[11,12,13],[14,15,16]]])
b=np.dsplit(a,3)
print(b)

Output:

[array([[[ 1],
        [ 4]],

       [[11],
        [14]]]), array([[[ 2],
        [ 5]],

       [[12],
        [15]]]), array([[[ 3],
        [ 6]],

       [[13],
        [16]]])]