numpy.vsplit() function with example in python

Spread the love

numpy.vsplit() function: This function Split an array into multiple sub-arrays vertically (row-wise).

Syntax: numpy.vsplit(ary, indices_or_sections)

import numpy as np x=np.array([[1,2,3,4],[5,6,7,8]]) y=np.hsplit(x, 2) print(y)

Output:

[array([[1, 2],
[5, 6]]),

array([[3, 4],
[7, 8]])]

admin

admin

Leave a Reply

Your email address will not be published. Required fields are marked *