In general, NumPy arrays are a homogeneous kind of data structure that has the same types of items. The main benefit of an array is its certainty of storage size because of its same type of items. A Python list uses a loop to iterate the elements and perform operations on them. Another benefit of NumPy arrays is to offer vectorized operations instead of iterating each item and performing operations on it. NumPy arrays are indexed just like a Python list and start from 0. NumPy uses an optimized C API for the fast processing of the array operations.
Let's make an array using the arange() function, as we did in the previous section, and let's check its data type:
# Creating an array using arange()
import numpy as np
a = np.arange(1,11)
print(type(a))
print(a.dtype)
Output:
<class 'numpy.ndarray'>
int64
When you use type(), it returns numpy.ndarray. This means that the type() function returns the type of the container. When you use dtype(), it will return...