Use of primitives

Hi, everybody ! Recently I was trying to use the primitives for recording a movement, however when I execute my code and as you can see in the image I found this error message —> ValueError: cannot convert float NaN to integer.
When I execute this recording program it doesn’t works.
Does someone knows how can I fix this problem?
Thanks!