I want to convert specific strings to floats with the csv read file, but cant figure it out.
with open('diamonds_testing.csv') as csv_file:
csv_reader = csv.reader(csv_file)
diamond = list(csv_reader)
print(diamond[1])
print(diamond[2])
output:
['0.23', 'Ideal', 'E', 'SI2', '55', '3.95', '3.98', '2.43']
['0.31', 'Very Good', 'J', 'SI1', '62', '4.39', '4.43', '2.62']
I want to output to be floats in columns 0,4,5,6,7. Thank you.