#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[arr < lower_limit] = lower_limit
clipped_arr[arr > upper_limit] = upper_limit

print(clipped_arr)