I have a list of 30,000 elements, each of the element is a list in itself {{a, b}, {p, q, r}, {a, p}, ..., {z, x}}
. Second one contains unique elements {a, b, c, ..., z}
.
I want to create an association which associates all the unique elements to the first list so that it shows whether the corresponding element is present in the first list. So, it should look something like this:
{
{<|a -> True, b -> True, c -> False, ..., z -> False|>},
{<| a -> False, b -> False, ..., p -> False, q -> False, r -> False, ..., z -> False |>},
...
}
Is there a way I can do this without loops?
List
. Why not just a list of associations? $\endgroup${{<|a -> True, b -> True, c -> False, ..., z -> False|>}, {<| a -> False, b -> False, ..., p -> False, q -> False, r -> False, ..., z -> False |>}, ...}
. $\endgroup$