I don't know if you solved this already. You have to check for 0 length indexes before the for loop like this:
if len(indexes) > 0:
for i in indexes.flatten():
....
That way it won't enter the for loop when indexes length is 0 which is causing the error.
Regards!
Answer from andrestascon on Stack Overflowpython - I'm getting an attribute error using tensorflow - Stack Overflow
I'm getting an attribute error using tensorflow - D Programming Language Discussion Forum
AttributeError: 'tuple' object has no attribute 't'
python - AttributeError: 'tuple' object has no attribute - Stack Overflow
Videos
You return four variables s1,s2,s3,s4 and receive them using a single variable obj. This is what is called a tuple, obj is associated with 4 values, the values of s1,s2,s3,s4. So, use index as you use in a list to get the value you want, in order.
obj=list_benefits()
print obj[0] + " is a benefit of functions!"
print obj[1] + " is a benefit of functions!"
print obj[2] + " is a benefit of functions!"
print obj[3] + " is a benefit of functions!"
You're returning a tuple. Index it.
obj=list_benefits()
print obj[0] + " is a benefit of functions!"
print obj[1] + " is a benefit of functions!"
print obj[2] + " is a benefit of functions!"
I am trying to make a discord bot that would turn a message into lowercase. I am encountering an error, as the title suggests, "AttributeError: 'tuple' object has no attribute 'lower'. "
Here is my code if anyone can help.
https://hastebin.com/ibareyilax.py
If this is the wrong subreddit I don't mind taking down my post and posting it elsewhere.