I created a list using IsotopeData command. There are some elements in the list which are Missing["NotAvailable"]. I want to have the only available data in the list. Here is my code:

IsotopeData[{94, 236}, "DecayEnergies"]

which gives me

{Quantity[5867.07, "Kiloelectronvolts"], Missing["NotAvailable"], 
Missing["NotAvailable"], Quantity[-1588.01, "Kiloelectronvolts"]}

But in fact I want to have a list like:

{Quantity[5867.07, "Kiloelectronvolts"], Quantity[-1588.01, "Kiloelectronvolts"]}

How can I figure it out?

  • 3
    $\begingroup$ DeleteMissing? $\endgroup$
    – Szabolcs
    Commented Jul 29, 2018 at 17:12
  • $\begingroup$ See also: (1235) $\endgroup$
    – Mr.Wizard
    Commented Jul 29, 2018 at 17:36
  • $\begingroup$ What's the fun in finding duplicates? :) OK, a better match would have been Deleting missing data with CountryData $\endgroup$
    – rhermans
    Commented Jul 29, 2018 at 17:38

1 Answer 1


Your data

list = IsotopeData[{94, 236}, "DecayEnergies"]

There are many ways

list /. Missing[_] -> Nothing (* Replace all instances of a pattern       *)

DeleteMissing[list]           (* A specialized function just for that     *)

Cases[list, _Quantity]        (* Get Cases with the correct Head          *)

DeleteCases[list, _Missing]   (* Delete cases with the wrong Head         *)

Select[list, Not@*MissingQ]   (* Select cases for which MissingQ if False *)

all give

{Quantity[5867.07, "Kiloelectronvolts"], 
 Quantity[-1588.01, "Kiloelectronvolts"]}

The way to figure it out should have been to read the documentation for Missing

Mathematica graphics

  • 1
    $\begingroup$ There's MissingQ, too, but I don't know how it differs from _Missing. It may be as simple as MissingQ[_Missing] := True; MissingQ[_] := False, but I honestly don't know. $\endgroup$
    – rcollyer
    Commented Jul 29, 2018 at 17:23

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