adding matrices of strings

Louis Luangkesorn lluang at northwestern.edu
Thu Oct 5 09:31:39 EDT 2000


Tim et al

Many thanks.  I think it is just that I'm new to Python so I was trying
A[i,j] a la Matlab instead of A[i][j] like I should have been.  (see William
Park's post).  Things like this get easier over time, right?

Louis

Tim Hochberg wrote:

> > 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

--
Louis Luangkesorn
lluang at northwestern.edu   http://pubweb.nwu.edu/~kll560
Who am I? They mock me, these lonely questions of mine. Whoever I am, Thou
knowest, O God, I am thine.
        - Dietrich Bonhoeffer "Who am I?"





More information about the Python-list mailing list