C5W3A2 Getting error despite all tests passed

I got all my test passed for the first 4 exercises, but at the ‘insert_one’ function even when I get all test passed the next cell after test cell gives an error ‘index 1375 is out of bounds for axis 1 with size 1375’
put when I use 'insert_ones’function in ‘create_training_example’ it works well giving exactly the expected output with all test passed
I checked my inesrt_ones function implementation but can’t find what causes the error

my implementation:
for i in range(segment_end_y+1,segment_end_y+51):
if i < segment_end_ms:
y[0, i] = 1
I thinkthe problem is with my if statement, but I can’t find it
could you please help my assignment due is tomorrow

1 Like

The if statement should use Ty, because that marks the size of the y variable. You don’t want to try to insert 1’s past the end of y.