Closed kmshort closed 6 years ago
Hi, thanks for raising this issue. I've added this to the list of feature requests here: Issue #45
In the meantime, consider converting to integer arrays using np.unique like this:
Atable,Ai = np.unique(A, return_inverse=True)
Btable,Bi = np.unique(B, return_inverse=True)
Here Ai
and Bi
are vectors containing integer representations of the original A
and B
labels, and the actual labels can be retrieved via the mappings in Atable
and Btable
.
I'm not sure what your feelings are on this, but it would be great if the values for the group/subgroup factors could be strings. At the moment, an error is thrown "invalid literal for int() with base 10: 'somegroupname'".
For example:
returns
and this is just for factor A, the same issue would be raised with factor B..
Perhaps in-code, string factors could be coerced to ints, and then at the end of processing returned as their original strings?