Reputation: 1539
I am trying to read a file with complex numbers in the form :
data.dat
1.5795219122457646E-11-3.852906516379872E-15i -3.5949335665378405E-12-1.626143709108086E-15i
-6.720365121161621E-15-5.377186331212649E-17i -3.736251476362349E-15-3.0190920417856674E-17i
I use the following code to read the file :
import numpy as np
c_complex = np.loadtxt('data.dat', delimiter='\t', dtype=np.complex128)
But it gives me the following error :
TypeError: complex() argument must be a string or a number, not 'bytes'
What could I do to solve this problem ?
Thank you very much for your help
Upvotes: 3
Views: 2490