Error displaying animation

This is incomplete code or the formatting got messed up because you didn’t use fenced code blocks to share code. (I get SyntaxError: invalid decimal literal concerning the 3i in arr = np.array( [[math.sin(3i/100), math.cos (3i/100), (1/100)**2, (i/100)**3, 1/(1+i/100)] for i in range(0,300)]).) And so I cannot actually test before suggesting things.

I suspect though you are looking to install and use ipympl. See here above the ’ Optional version with a player controller …’ section. You’ll need to transpose it to your code. It should mainly mean changing things to add %matplotlib ipympl at the start of the cell with the animation.