Week4 - Exercise 2

I have an error and I’m not too sure why. Could someone help me?

angle_rads = get_angles(positions, [0, 1, 2, ..., d-1], d)

angle_rads[:, 0::2] = np.sin(angle_rads)

angle_rads[:, 1::2] = np.cos(angle_rads)

You need to include the slicing indices inside the np.sin() and np.cos() calls.

Doing np.sin(angle_rads[: , 0::2]) still gives me the same error →

TypeError: unsupported operand type(s) for //: ‘list’ and ‘int’

It seems to come from the first line*

Problem was in the first line. Got it