Say I have a list of values and one returns Indeterminate. Is there a way to replace it with say NaN and then keep the rest of the list?
1 Answer
$\begingroup$
$\endgroup$
How you want to do this probably depends on what you want to do with the list later. In Mathematica, Indeterminate is a kind of NaN. But if the intent is to remove the offending value, you can do something like this:
list = {1, 2, 3, 0/0, 4, 5, 6};
blist = list /. Indeterminate -> Nothing
Now blist is {1,2,3,4,5,6}
NaN
? How is that better than havingIndeterminate
? Maybe you can tell us what you're trying to achieve and howIndeterminate
is interfering with that. $\endgroup$DeleteCases[<your list>, Indeterminate]
$\endgroup$