Bitwise operations on strings lil_matrix
1 answer
By "lil_matrix", do you mean scipy.sparse.lil_matrix? If so, you will have to convert your sparse array to a regular dense array in order to perform bitwise operations on it, I suppose.
a = np.asarray(A.todense())
np.bitwise_and(a[1,:], a[2,:])
Should do the trick I think ...
EDIT: Forgot the "asarray" in there ...
+3
a source to share