I have a question I came up with that I would like to answer. What is the radius of all the planets who have at least one moon with a density that is greater than or equal to 0.55 times the density of Earth's moon? I have computed a dataset but I don't know how to filter with SortBy. For example the following code gives the number of moons Jupiter has that exeeds or equals Earth's moons density times 0.55
planets["Jupiter", "Moons",
Length@*Select[#Mass/(4/3 \[Pi] #Radius^3) >
0.55 (planets["Earth", "Moons",
Values, #Mass/(4/3 \[Pi] #Radius^3) &] // Normal //
First) &]]
I can also compute this for all planets with
planets[All, "Moons",
Length@*Select[#Mass/(4/3 \[Pi] #Radius^3) >
0.55 (planets["Earth", "Moons",
Values, #Mass/(4/3 \[Pi] #Radius^3) &] // Normal //
First) &]]
I tried the following code but it returned an empty list. It should return Earth, Mars, Jupiter, Saturn, and Neptune.
planets[Select[
planets[#, "Moons",
Length@*Select[#Mass/(4/3 \[Pi] #Radius^3) >
0.55 (planets["Earth", "Moons",
Values, #Mass/(4/3 \[Pi] #Radius^3) &] // Normal //
First) &]] >= 1 &], "Mass"]
How can I finish my complex query? I am using
ExampleData[{"Dataset", "Planets"}]