Fungsi bentuk python numpy contoh mencetak bentuk array multidimensi

# Welcome to softhunt.net
import numpy as npy
 
# creating a 2-d array
arr1 = npy.array([[4, 5, 6, 7], [1, 2, 3, 4]])
 
# creating a 3-d array
arr2 = npy.array([[[8, 7], [6, 5]], [[4, 3], [2, 1]]])
 
# printing the shape of arrays
# first element of tuple gives
# dimension of arrays second
# element of tuple gives number
# of element of each dimension
print(arr1.shape)
print(arr2.shape)
Outrageous Ostrich