I have this list of complex numbers, and I like to just have the real parts. but this happens;
mylist = {"-0.0008254407622034586 - 0.00027208294839600484*I",
"-0.002337775697077904 - 0.0010944345849494001*I",
"0.0007542764998269973 - 0.0015145500329643122*I",
"-0.0010752208480672588 + 0.002930836636307818*I",
0.470030622499595`,
"-0.46317756817175976 - 0.0052659322646682214*I"}
Re[mylist]
{Re["-0.0008254407622034586 - 0.00027208294839600484*I"],
Re["-0.002337775697077904 - 0.0010944345849494001*I"],
Re["0.0007542764998269973 - 0.0015145500329643122*I"],
Re["-0.0010752208480672588 + 0.002930836636307818*I"], 0.470031,
Re["-0.46317756817175976 - 0.0052659322646682214*I"]}
How can I get the Real parts only?
Re@*ToExpression /@ mylist
will work, but as @Fraccalo mentioned, it would be much better if you found out why your numbers are not numbers but strings: that would fix the problem at the source. $\endgroup$ – MarcoB Dec 6 '19 at 17:15