import numpy as np arr = np.empty((0,3), int) print("Empty array:") print(arr) arr = np.append(arr, np.array([[10,20,30]]), axis=0) arr = np.append(arr, np.array([[40,50,60]]), axis=0) print("After adding two new arrays:") print(arr)
Here is what the above code is Doing:
1. Create an empty array with 0 rows and 3 columns.
2. Add a new row to the array with the values 10, 20, 30.
3. Add a new row to the array with the values 40, 50, 60.
4. Print the resulting array.