I am struggling with extracting specific rows from a dataset.
dataset =
Dataset[{<|"a" -> 1, "b" -> "x", "c" -> {1}|>, <|"a" -> 2,
"b" -> "y", "c" -> {2, 3}|>, <|"a" -> 3, "b" -> "z",
"c" -> {3}|>, <|"a" -> 4, "b" -> "x", "c" -> {4, 5}|>, <|"a" -> 5,
"b" -> "y", "c" -> {5, 6, 7}|>, <|"a" -> 6, "b" -> "z",
"c" -> {}|>}]
I would like to get a new dataset consisting only of examples that have a specific number in column "a" (for example {2,4,5})
I can retrieve one specific row by using the following:
Select[dataset, #a == 2 &]
:
But I don't know how to do that for a list with the given numbers. I tried the following which gave me an empty dataset:
Select[dataset, #a == {2, 4, 5} &]
Thank you very much for your help.