Thank you for your attention.
But as I replace this line with
stats.episode_rewards[i_episode] = stats.episode_rewards[i_episode] + reward

there will be the same error. I think this line might not be the point of this error.