I have found something like this from this comment
Did you include a line
# r: numpy
before you do
import numpy