-2

enter image description here

I add for you a picture for better comprehension, seems like if colab could not read or transform the value from Excel which I uploaded in a "csv" file.

Could someone give me some idea to solve it?

  • Does this answer your question? [How can I convert a string with dot and comma into a float in Python](https://stackoverflow.com/questions/6633523/how-can-i-convert-a-string-with-dot-and-comma-into-a-float-in-python) – zhuhang.jasper Aug 04 '21 at 11:40

1 Answers1

0

First of all, it is Python language. Because your string has comma ",". You need to perform string replace first to remove all commas before parsing as float.

Sample:

value = '10,181.23'

# convert string with comma to float
num = float(value.replace(',', ''))

print(num) # 10181.23
print(type(num)) # <class 'float'>

As described here: https://thispointer.com/python-convert-string-float/

zhuhang.jasper
  • 4,120
  • 4
  • 21
  • 29