#Import the NumPy library
import numpy as np
arr = np.array([1, 3, 2, 4, 5])
lower_limit = 2
upper_limit = 4
clipped_arr = arr.copy()
#Creating conditions to apply limits to every element in array
# (both conditions are applied to every element)
clipped_arr = np.where(arr < lower_limit, lower_limit, arr)
clipped_arr = np.where(clipped_arr > upper_limit, upper_limit, clipped_arr)
print(clipped_arr)