Group Abstract Group Abstract

Message Boards Message Boards

1
|
3.2K Views
|
3 Replies
|
7 Total Likes
View groups...
Share
Share this post:

How to filter planets according to conditions using SortBy?

POSTED BY: Peter Burbery
3 Replies
Posted 2 years ago

POSTED BY: Dave Middleton

I want to see the radius of the planets that meet the criterion, not the length. I figured out how to get the radius of planets:

planets[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) &]][Select[# > 0 &]]//Keys//Normal,"Radius"]
POSTED BY: Peter Burbery
Posted 2 years ago

Maybe this?

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) &]][Select[# > 0 &]]
POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard