could not broadcast input array from shape (2,3) into shape (3) while using timestamp to build neural network in python
First of all, you should use separate variables for the 3D and 2D x_trains:

x_train_n = np.zeros((x_train.shape[0] - num_time_steps + 1, num_time_steps, num_features), dtype="float32")
x_test_n = np.zeros((x_test.shape[0] - num_time_steps + 1, num_time_steps, num_features), dtype="float32")


And, your outer loop should span the new x_train, i.e. x_train_n:

for i in range(len(x_train_n)):
   for timestep in range(num_time_steps):
       x_train_n[i][timestep] = x_train[i + timestep].squeeze()


Change the other loop (the one for the test case) as well.