Python Forum
object cannot be interpreted as an integer
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
object cannot be interpreted as an integer
#1
Hello,

I am a beginner programmer working on a Python project. - Using Python 3.6 and Windows 10
I need help interpreting this error message before taking too many guesses at what might be the root of the problem. I suppose the root of the problem is that I don't know what the error message is referring to with the word "object". I know what an integer is. But, I have no idea as to why
there is reference to an "integer". These variables being used here are not integers. There are lots of lines of code in the module, but here
I supply a small bit of the code(starting with line 182). Then below is the error message. Any pointes will be appreciated.

Thanks!

if (count<20):
    summary1="too few samples"
elif (tBias<TBLimNineFivePct and tslope<TSLimNineFivePct and SEP<(AppNoteSEP*faccuracynintyfivepct)):
    summary1="PASS"
elif ((tBias>TBLimNineFivePct or abs(Bias)*2.5>tBias) and tslope<TSLimNineFivePct and SEP<(AppNoteSEP*faccuracynintyfivepct)):
    summary1=("Bias adjustment is recommended. Add ",Bias," to existing Bias for a new Bias setting of:",newBias)  
elif (tBias>TBLimNineFivePct or SEP(AppNoteSEP*faccuracynintyfivepct)):
    summary1="Calibration update is recommended"
Error:
Traceback (most recent call last): File "C:\Users\3135\eclipse-workspace\NIR Automated Validation\soynirvalidation.py", line 186, in <module> elif ((tBias>TBLimNineFivePct or abs(Bias)*2.5>tBias) and tslope<TSLimNineFivePct and SEP<(AppNoteSEP*faccuracynintyfivepct)): TypeError: 'numpy.float64' object cannot be interpreted as an integer
Reply
#2
use type() to find the culprit
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  TypeError: 'Series' object cannot be interpreted as an integer evelynow 2 7,678 Sep-11-2019, 02:43 PM
Last Post: timmahoney

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020