ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 21 May 2013 05:18:11 -0500Pulling the index of an entry of a matrixhttp://ask.sagemath.org/question/10144/pulling-the-index-of-an-entry-of-a-matrix/Let $M$ be some matrix, then I am looking for how to find out which entries of $M$ make the statement `M[i,j] == 25` true. Specifically, this is the code I'm using to generate the matrix, called `deg`:
deg = matrix(ZZ, 15)
A = lambda i: WeylCharacterRing("A{0}".format(i), style = "coroots")
for i in range(1,15):
fw = A(i).fundamental_weights()
for j in range(1,len(fw)):
deg[i,j] = A(i)(fw[j]).degree()
print deg
It works great, but now instead of printing deg and finding the entries manually, I would like to be able to store which entries `[i,j]` of `deg` are equal to 25 in some list, and then print that list, which would ideally look something like:
list(tfentry)
{ (2,3), (4,4) }
etc.
Any tips on where to look or help files to examine?
Thanks very much.
JoshIzzardTue, 21 May 2013 05:18:11 -0500http://ask.sagemath.org/question/10144/