Hi Very, very, part-time user of Mathematica, and i'm sure it'll show in my question.
i'm trying to get a very simple table of astronomical data together. Let's take a simple example
dwarves := EntityList[EntityClass["MinorPlanet", "DwarfPlanet" ]
I want to only return entries from the list the radius is not missing. This has proven ridiculously hard for me. I have a function i can experiment with:
filteredDwarves := DeleteCases[l, p_ /; shouldFilter[p]]
For shouldFilter, I have tried a million things, for example:
shouldFilter[planet_] := MinorPlanetData[planet, "Radius"] == Missing[_]
shouldFilter[planet_] := MinorPlanetData[planet, "Radius"] == _Missing
shouldFilter[planet_] := MinorPlanetData[planet, "Radius"] >Quantity[0.0,"miles"]
I even tried a ridiculous text thing:
shouldFilter[planet_] := Text[MinorPlanetData[planet, "Radius"] ]=="Missing"NotAvailable""
(pasted from a previous result) + other stuff
This ridiculous contraption WORKED:
shouldFilter[planet_] := Length[DeleteMissing[{MinorPlanetData[planet, "Radius"]}]] == 0
I've spent a long time looking at documentation + internet to no avail. Any help appreciated, what's the best way of doing this
Thanks!