code: def calc_complex(mag, pha):
      ''' Calculate real and imaginary part of the complex conductivity from
      magnitude and phase in log10.
      '''
      complx = [10 ** m * math.e ** (1j * p / 1e3) for m, p in zip(mag, pha)]
      real = [math.log10((1 / c).real) for c in complx]
      imag = []
      for c in complx:
          if ((1 / c).imag) == 0:
              imag.append(math.nan)
          else:
              i = math.log10(abs((1 / c).imag))
              imag.append(i)
      return real, imaf calc_complex(mag, pha):
      ''' Calculate real and imaginary part of the complex conductivity from
      magnitude and phase in log10.
      '''
      complx = [10 ** m * math.e ** (1j * p / 1e3) for m, p in zip(mag, pha)]
      real = [math.log10((1 / c).real) for c in complx]
      imag = []
      for c in complx:
          if ((1 / c).imag) == 0:
              imag.append(math.nan)
          else:
              i = math.log10(abs((1 / c).imag))
              imag.append(i)
      return real, imag
docs: Calculate real and imaginary part of the complex conductivity from
      magnitude and phase in log10.