# Importing 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
temp = np.copy(arr[0])
arr[0] = arr[2]
arr[2] = temp
#Displaying result
print(arr)