Python newbie here using Python 2.7 and working from a boilerplate. I came across this line in a boilerplate function which is causing problems for me:
x[x < -100] = -100
The comment says that this is supposed to prevent overflow, but I have no idea how. The x that I am passing in is a float. I tried searching the python documentation but maybe I was using the wrong keywords? Can anybody help me understand this? Thanks!
xis a float then this code will raise aTypeErrorbecause floats don't support indexing.