python check if string can be cast to float code example
Example 1: check if can convert to float python
try:
float(element)
except ValueError:
print "Not a float"
Example 2: python cast to float
float('1.234')
try:
float(element)
except ValueError:
print "Not a float"
float('1.234')