Curriculum
Course: NumPy
Login

Curriculum

NumPy

Text lesson

Split Into Arrays

The return value of the array_split() method is an array where each split is stored as a sub-array.

If you divide an array into 3 parts, you can access each part from the result just like you would with any array element.

Example

Access the split arrays:

import numpy as np

arr = np.array([123456])

newarr = np.array_split(arr, 3)

print(newarr[0])
print(newarr[1])
print(newarr[2])