Created by FdoBadLinked to 79m issues across 234 teams
The error message ValueError: invalid literal for int() with base 10: ''.
signals that the string provided to int
wasn't able to be parsed properly as an integer. This is because (in the above case), the input was an empty string: ''
.
In order to convert a string that represents a floating-point value to an integer, you must first convert it to a float
using the float
function. For example:
>>> int(float('55063.000000'))
This will return the integer 55063