How to a turn a list of strings into complex numbers in python?

前端 未结 5 721
刺人心
刺人心 2021-01-19 19:33

I\'m trying to write code which imports and exports lists of complex numbers in Python. So far I\'m attempting this using the csv module. I\'ve exported the data to a file u

5条回答
  •  感情败类
    2021-01-19 20:18

    complex_out = []
    for row in out:
        comp_row = [complex(x) for x in row]
        complex_out.append(comp_row)
    

提交回复
热议问题