The values of Z' and Z'' in the output file don't match those in the input csv file. In fact, they don't match any data from there. This occurred for an input file that contained simultaneously Z', Z'', |Z| and theta, a possibility that wasn't foreseen. The reason is the code automatically tries to convert |Z| and theta into Z' and Z'' if it finds 'Impedance Magnitude (Ohms)' in the 4th headline. But, since Z' and Z'' were also present, the code has mistaken them for |Z| and theta. As a result, absurd values are output.
To fix this bug, the code should make sure that Z' and Z'' aren't already in the input before trying to obtain them from |Z| and theta. This can be checked in the 4th headline of the input.