1
$\begingroup$

I have some data in TSV format and am attempting to import it into Mathematica. Real values import just fine, but complex values keep on getting interpreted as strings.

I attempted to figure out what format Mathematica was looking for by exporting some complex values in TSV, but interestingly enough Mathematica fails to import complex TSV values that it exported itself! Is there any way to import complex values through TSV in Mathematica?

$\endgroup$
3
$\begingroup$

I figured this one out. You simply need to pass the imported array through ToExpression, which converts strings formatted as a+bI to the proper imaginary values.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.