inverted table
x
┌──────┬──────┬────────────────────┐
│Smith │John │23 29 47 23 31 23 23│
│Jones │Dakota│ │
│Chan │Wilson│ │
│Wilson│Diana │ │
│Saxon │Joan │ │
│Smith │John │ │
│Wilson│John │ │
└──────┴──────┴────────────────────┘
,.&.> x
┌──────┬──────┬──┐
│Smith │John │23│
│Jones │Dakota│29│
│Chan │Wilson│47│
│Wilson│Diana │23│
│Saxon │Joan │31│
│Smith │John │23│
│Wilson│John │23│
└──────┴──────┴──┘
| |
inverted table index-of
{(⍉↑⍺⍳¨⍺)⍳(⍉↑⍺⍳¨⍵)}
(|:x i.&>x) i. (|:x i.&>y)
i.&>~@[ i.&|: i.&>
|
|
replaces a 28-line ∇ function; faster by a factor of 1.2 |
x(8⌶)y |
|
ignores trailing spaces; uses CRC32; faster by a factor of 10 to 40 (5 to 20 with more conventional hashing) |
|