DLS Course 5 Week1 A2: sample() is generating wrong sequence

Hi, My sample() function is generating a sequence of indices that doesn’t match with the test output except the first index. I am suspecting my code sampling the probability distributions. I am passing range(vocab_size) and p=y[ : , counter] as the parameters to np.random.choice() and getting the following sequence:

list of sampled indices:
[23, 7, 15, 26, 25, 23, 21, 14, 23, 23, 7, 16, 26, 24, 18, 14, 10, 0]

Expected:
list of sampled indices:
[23, 16, 26, 26, 24, 3, 21, 1, 7, 24, 15, 3, 25, 20, 6, 13, 10, 8, 20, 12, 2, 0]

I will appreciate any explanation or hints on this. Thanks.

The instructions give vague hints that imply you should use y.ravel(), instead of y[:,counter].

Thanks @TMosh. The problem is solved.