0

I need to change a big amount of data in a column from e.g. "81,33" to "81.33". Is it possible to change "," to "." and execute it with a For Loop for all values in one column?

Thank you!

1 Answers1

0

It is possible.

float_numbers_as_strings = ["81,33", "44,55", "6565,4", "50,0", "5"]
float_numbers_as_strings = [number.replace(",", ".") for number in float_numbers_as_strings]

You can do it in a for loop and use replace. In my example I did the shorthand version of the for loop.

Tin Nguyen
  • 5,250
  • 1
  • 12
  • 32