Converting exponential to float

前端 未结 6 1431
余生分开走
余生分开走 2020-12-18 08:55

This is my code, trying to convert the second field of the line from exponential into float.

outputrrd = processrrd.communicate()
(output, error) = outputrrd         


        
6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-18 09:24

    Simply by casting string into float:

    new_val = float('9.81E7')
    

提交回复
热议问题