C5W1A2_AssertionError: Wrong values

Hello together,

I hope you have a great weekend and are looking forward for Chrismas time!

I am stuck with Assignment 2 Exercise 2 as I get the wrong value for the 5th and 6th position and am not able to finde the mistake.

The shapes of my variables are:
X: (27,1)
a_prev (100,1)
a (100,1)
z (27,1)
y (27,1)

and for
idx I use p = y.ravel() as propability distribution
and x[idx] = y[idx]

Can you please give me hint?

edit:
Sampling:
list of sampled indices:
[23, 16, 26, 26, 19, 25, 22, 16, 7, 11, 17, 26, 23, 23, 23, 18, 10, 6, 12, 2, 14, 24, 14, 17, 7, 18, 0]
list of sampled characters:
[‘w’, ‘p’, ‘z’, ‘z’, ‘s’, ‘y’, ‘v’, ‘p’, ‘g’, ‘k’, ‘q’, ‘z’, ‘w’, ‘w’, ‘w’, ‘r’, ‘j’, ‘f’, ‘l’, ‘b’, ‘n’, ‘x’, ‘n’, ‘q’, ‘g’, ‘r’, ‘\n’]

Found the mistake x[idx] needs to be 1 not -1 or y[idx] …

Hey I was also stuck here, can you explain why this works please? Why x[idx] = 1. Is it like a boolean filter, letting only the letter corresponding to x[idx] pass?