Skip to content
Advertisement

Error in Float can’t be interpreted as an integer in old code

I am trying to reuse this old function generated by a former employee and the company I now work at and am receiving the error “TypeError: object of type <class ‘float’> cannot be safely interpreted as an integer.” I thought I could fix it quite easily with integer division // but that doesn’t seem to be fixing the issue.

JavaScript

Advertisement

Answer

numpy.linspace requires an integer for its third parameter:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement