Nov-05-2022, 07:34 AM
(This post was last modified: Nov-05-2022, 08:09 AM by Yoriz.
Edit Reason: Added code tags
)
I being ask to create a random integer array with the info below:
● Create two random integer array of values 0 to 14 of size ten called x and y.
Concatenate x and y using the concatenate method. Assign it to Q5.
my code is :
● Create two random integer array of values 0 to 14 of size ten called x and y.
Concatenate x and y using the concatenate method. Assign it to Q5.
my code is :
np.random.seed(56) x = np.random.randint(15, size= (10)) y = np.random.randint(15, size= (10)) Q5 = np.concatenate([x,y]) print(Q5)my print:
Output:[ 5 4 0 2 11 10 14 9 11 7 6 4 9 10 7 1 8 12 2 14]
correct print is:Output:[ 5 3 2 5 1 5 1 11 14 10 4 3 9 7 6 7 7 14 0 4]
wondering why the answer print from my code doesnt match the correct answer code. I have assign seed of 56.