import numpy as np
array = np.zeros((5,5)) # Create a 2D array of zeros
n = 3 # Generate n random values
values = np.random.rand(n) # Generate n random indices
indices = np.random.choice(np.arange(5*5), size=n, replace=False)
# Reshape the array and assign the random values to the selected indices
array = np.reshape(array, -1)
array[indices] = values
array = np.reshape(array, (5, 5))
print(array)