Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python NumPy vsplit Function

# welcome to softhunt.net
# Vertical array splitting using np.hsplit()
import numpy as np


# Making of a 3x3 array
a = np.arange(9).reshape(3, 3)

# Vertical splitting of array
# 'a' using np.hsplit().
print("The array: 
 {} 

 gets splitted Vertically to form: 
 {} ".format(a, np.vsplit(a, 3)))

# Vertical splitting of array 'a'
# using 'split' with axis parameter = 0.
print("
 The array: 
 {} 

 gets splitted Vertically to form: 
 {} ".format(a, np.split(a, 3, 0)))
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Python #NumPy #vsplit #Function
ADD COMMENT
Topic
Name
8+4 =