<!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!&nbsp; Say, I've got a numpy 
array/matrix of the form:</FONT></DIV>
<DIV><FONT face=Garamond color=#000080></FONT>&nbsp;</DIV>
<DIV><FONT face=Garamond color=#000080>[[1 6 1 2 3]<BR>&nbsp;[4 5 4 7 
0]<BR>&nbsp;[2&nbsp;0 8&nbsp;0 2]<BR>&nbsp;[8 2 6 3 0]<BR>&nbsp;[0 7&nbsp;0 3 
5]<BR>&nbsp;[8&nbsp;0 3&nbsp;0 6]<BR>&nbsp;[8 0 0 2 2]<BR>&nbsp;[3 1&nbsp;0 4 
0]<BR>&nbsp;[5&nbsp;0 8&nbsp;0 0]<BR>&nbsp;[2 1 0 5 6]]</FONT></DIV>
<DIV><FONT face=Garamond color=#000080></FONT>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=Garamond color=#000080>How do I do this?</FONT></DIV>
<DIV><FONT face=Garamond color=#000080></FONT>&nbsp;</DIV>
<DIV><FONT face=Garamond color=#000080>Thanks!</FONT></DIV>
<DIV><FONT face=Garamond color=#000080></FONT>&nbsp;</DIV>
<DIV><FONT face=Garamond color=#000080>Dinesh</FONT></DIV>
<DIV><FONT face=Garamond color=#000080></FONT>&nbsp;</DIV></BODY></HTML>