This code form documention of Dataset in ref/Dataset->Applicastions->Indexed Tables(Associations of Associations):
planets = ExampleData[{"Dataset", "Planets"}];
moonMass = planets["Earth", "Moons", "Moon", "Mass"];
planets[All, "Moons", Select[#Mass > moonMass/2 &] /* Keys]
But I cannot understand this behavior all the time.I this that Keys should act on the last result to get a outcome same with Keys[planets[All,"Moons",Select[#Mass>moonMass/2&]]].I make example for simulate it.
dataset = Dataset[<|
ld -> <|"a" -> 1, "b" -> "x", "c" -> {1}|>,
le -> <|"a" -> 2, "b" -> "y", "c" -> {2, 3}|>,
lf -> <|"a" -> 3, "b" -> "z", "c" -> {3}|>,
lg -> <|"a" -> 4, "b" -> "x", "c" -> {4, 5}|>,
lh -> <|"a" -> 5, "b" -> "y", "c" -> {5, 6, 7}|>,
li -> <|"a" -> 6, "b" -> "z", "c" -> {}|>|>]
dataset[Select[#a < 4 &] /* f, "c"]
f[<|ld -> {1}, le -> {2, 3}, lf -> {3}|>] As we can see,the
fact on the last result.If we want to get a result same to the documentation,the code should be:
dataset[Select[#a < 3 &] /* (Keys /@ # &)]
Do anyone agree this this opinion?
