<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=iso-8859-1>
<META content="MSHTML 6.00.6000.16705" name=GENERATOR></HEAD>
<BODY id=MailContainerBody
style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px"
bgColor=#ffffff leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT face=Garamond color=#000080>Hi! Say, I've got a numpy
array/matrix of the form:</FONT></DIV>
<DIV><FONT face=Garamond color=#000080></FONT> </DIV>
<DIV><FONT face=Garamond color=#000080>[[1 6 1 2 3]<BR> [4 5 4 7
0]<BR> [2 0 8 0 2]<BR> [8 2 6 3 0]<BR> [0 7 0 3
5]<BR> [8 0 3 0 6]<BR> [8 0 0 2 2]<BR> [3 1 0 4
0]<BR> [5 0 8 0 0]<BR> [2 1 0 5 6]]</FONT></DIV>
<DIV><FONT face=Garamond color=#000080></FONT> </DIV>
<DIV><FONT face=Garamond color=#000080>And, I want to create a dictionary of
rows (as the keys) mapped to lists of non-zero numbers in that row
ie.</FONT></DIV>
<DIV><FONT face=Garamond color=#000080></FONT> </DIV>
<DIV><FONT face=Garamond color=#000080>dictionary_non-zeros = {</FONT></DIV>
<DIV><FONT face=Garamond color=#000080>0: [1 6 1 2 3]</FONT></DIV>
<DIV><FONT face=Garamond color=#000080>1: [4 5 4 7]</FONT></DIV>
<DIV><FONT face=Garamond color=#000080>2: [2 8 2]</FONT></DIV>
<DIV><FONT face=Garamond color=#000080>...</FONT></DIV>
<DIV><FONT face=Garamond color=#000080>9: [2 1 5 6]</FONT></DIV>
<DIV><FONT face=Garamond color=#000080>}</FONT></DIV>
<DIV><FONT face=Garamond color=#000080></FONT> </DIV>
<DIV><FONT face=Garamond color=#000080>How do I do this?</FONT></DIV>
<DIV><FONT face=Garamond color=#000080></FONT> </DIV>
<DIV><FONT face=Garamond color=#000080>Thanks!</FONT></DIV>
<DIV><FONT face=Garamond color=#000080></FONT> </DIV>
<DIV><FONT face=Garamond color=#000080>Dinesh</FONT></DIV>
<DIV><FONT face=Garamond color=#000080></FONT> </DIV></BODY></HTML>