I have a string '3,505.92' recognized from image, I have to convert into float, So i'm trying float('3,505.92'). But I'm getting error that saying
could not convert string to float: '3,505.92'
I don't want to remove comma.
I have a string '3,505.92' recognized from image, I have to convert into float, So i'm trying float('3,505.92'). But I'm getting error that saying
could not convert string to float: '3,505.92'
I don't want to remove comma.
You have to remove the comma if you want to convert it to float, use string.replace()
float('3,505.92'.replace(',', ''))