Write a Python Program to Find the length of a Numpy Array. The Python numpy module has a len function that returns the array length. In this Python example, we declared the integer and string array and used the len function to find those array lengths.
# Array Length
import numpy as np
intarr = np.array([10, 20, 35, 44, 78, 99, 248])
print("Integer Numpy Array Items = ", intarr)
intarrLength = len(intarr)
print("Integer Numpy Array Length = ", intarrLength)
strarr = np.array(['UK', 'India', 'USA', 'Japan'])
print("String Numpy Array Items = ", strarr)
strarrLength = len(strarr)
print("String Numpy Array Length = ", strarrLength)

This Python program allows entering the array items and calculates the Numpy Array Length.
# Array Length
import numpy as np
arrList = []
number = int(input("Enter the Total Array Items = "))
for i in range(1, number + 1):
value = int(input("Enter the %d Array value = " %i))
arrList.append(value)
intArr = np.array(arrList)
print("Integer Numpy Array Items = ", intArr)
intArrLength = len(intArr)
print("Integer Numpy Array Length = ", intArrLength)
