Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- d=Dataset[<|"r1" -> <|"c1" -> 8, "c2" -> 7, "c3" -> 9|>,
- "r2" -> <|"c1" -> 4, "c2" -> 10, "c3" -> 5|>,
- "r3" -> <|"c1" -> 2, "c2" -> 9, "c3" -> 6|>,
- "r4" -> <|"c1" -> 9, "c2" -> 1, "c3" -> 1|>,
- "r5" -> <|"c1" -> 9, "c2" -> 4, "c3" -> 4|>,
- "r6" -> <|"c1" -> 9, "c2" -> 7, "c3" -> 2|>,
- "r7" -> <|"c1" -> 2, "c2" -> 4, "c3" -> 2|>,
- "r8" -> <|"c1" -> 9, "c2" -> 6, "c3" -> 4|>,
- "r9" -> <|"c1" -> 2, "c2" -> 1, "c3" -> 6|>,
- "r10" -> <|"c1" -> 9, "c2" -> 1, "c3" -> 2|>|>]
- Transpose /* Query[All, Counts] /* Transpose /* SortBy[Keys]@d
- <|1 -> <|"c1" -> Missing["KeyAbsent", 1], "c2" -> 3, "c3" -> 1|>,
- 2 -> <|"c1" -> 3, "c2" -> Missing["KeyAbsent", 2], "c3" -> 3|>,
- 4 -> <|"c1" -> 1, "c2" -> 2, "c3" -> 2|>,
- 5 -> <|"c1" -> Missing["KeyAbsent", 5],
- "c2" -> Missing["KeyAbsent", 5], "c3" -> 1|>,
- 6 -> <|"c1" -> Missing["KeyAbsent", 6], "c2" -> 1, "c3" -> 2|>,
- 7 -> <|"c1" -> Missing["KeyAbsent", 7], "c2" -> 2,
- "c3" -> Missing["KeyAbsent", 7]|>,
- 8 -> <|"c1" -> 1, "c2" -> Missing["KeyAbsent", 8],
- "c3" -> Missing["KeyAbsent", 8]|>,
- 9 -> <|"c1" -> 5, "c2" -> 1, "c3" -> 1|>,
- 10 -> <|"c1" -> Missing["KeyAbsent", 10], "c2" -> 1,
- "c3" -> Missing["KeyAbsent", 10]|>|>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement