Elias Mårtenson
2017-07-05 09:43:34 UTC
I have a list of strings, and a corresponding set of categorisations:
* strings â 'foo' 'bar' 'abc' 'def' 'ghi' 'jkl'*
* categories â 1 1 0 2 1 0*
I now need to group these strings according to category. In other words,
when applying operation X, I need the following output:
* categories X strings*
âââââââââââââââââââââââââââââââââââââââââââ
ââââââââââââââ âââââââââââââââââââ ââââââââ
ââ"abc" "jkl"â â"foo" "bar" "hgi"â â"def"ââ
ââââââââââââââ âââââââââââââââââââ ââââââââ
âââââââââââââââââââââââââââââââââââââââââââ
What is the best way to solve this?
* strings â 'foo' 'bar' 'abc' 'def' 'ghi' 'jkl'*
* categories â 1 1 0 2 1 0*
I now need to group these strings according to category. In other words,
when applying operation X, I need the following output:
* categories X strings*
âââââââââââââââââââââââââââââââââââââââââââ
ââââââââââââââ âââââââââââââââââââ ââââââââ
ââ"abc" "jkl"â â"foo" "bar" "hgi"â â"def"ââ
ââââââââââââââ âââââââââââââââââââ ââââââââ
âââââââââââââââââââââââââââââââââââââââââââ
What is the best way to solve this?