[GIS] What does ValueError: invalid literal for int() with base 10 indicate

arcgis-desktoparcpy

# Process: Get Raster Properties
Max_Aggl = arcpy.GetRasterProperties_management(EucDist_Aggl, "MAXIMUM", "")
print (Max_Aggl)
print float(Max_Aggl.getOutput(0))
b = int(Max_Aggl.getOutput(0))
c = b/2
print c
delta = int(Max_Aggl.getOutput(0))
print delta
a = delta/1000
print a

This is a part of the code, and the value of Max_Aggl=44250.27734375 (more than 10 digits)
and I have error :

44250.27734375
44250.2773438

Traceback (most recent call last): File "D:\NEO\bbbb.py", line 22,
in
b = int(Max_Aggl.getOutput(0)) ValueError: invalid literal for int() with base 10: '44250.27734375'

you help me first time to convert the result to value

Best Answer

It seems that you are returning a string and not a number, and there is no direct conversion from float stored string to int in Python. So you should use :

delta = int(float(Max_Aggl.getOutput(0)))