Jens grønborg Jens grønborg - 4 months ago 35
Python Question

How to remove ' ' in a python list

I load a csv.file where the dataset comes in the form ('5.5','4.3'...)

How can I remove the ' '?

I've tried with replace, but it doesn't seem to work with the '.


It's basically:

['1'] => [1]


As you are working with float data type, the following list builder code (as previously pointed in the comments) should work.

row = [float(i) for i in row]