2
$\begingroup$

I have an Association with lots of key-value pairs. The values are integer numbers from a finite set. I'd like to group all the keys that have a certain number as value, and make a table with values (numbers) on top row (one per column) and each key set under each corresponding value.

I tried with GroupBy, with no success.

Edit Example:

<|key1->2, key2->4, key3->4, key4->2, key5->7, key6->4|>

Output: a table like this:

|  2     |   4     |  7      |
| key1   | key2    | key5    |
| key4   | key3    |         |
|        | key6    |         |
$\endgroup$
2
$\begingroup$
GroupBy[a, Identity, Keys] // Dataset
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.