adding matrices of strings

Tim Hochberg tim.hochberg at ieee.org
Wed Oct 4 21:35:51 EDT 2000


> Is there a way to add matrices of strings?  In other words, if I have
> matrices A and B, whose elements are strings, can i add them so I get C
> = A + B where C[i,j] = concatonate(A[i,j], B[i,j])

try:

import operator
C = map(operator.add, A, B)

> the other thing I need to do is to take that matrix A, and pull a
> particular element from it (without removing that element like a
> a.pop(x) would do)

Hmmm? Do you just want a[x]?

-tim

-tim






More information about the Python-list mailing list