#Import the NumPy library import numpy as np #Creating a 2D NumPy array arr = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) #Swapping the first and third rows arr[0], arr[2] = arr[2], arr[0].copy() #Displays result print(arr)