I have q = [[7,2,3],[4,5,6]] and r=[[6,1,2],[3,4,5]]. I need to divide q by the corresponding elements in r. (i.e. [[7/6,2/1,3/2],[4/3,5/4,6/5]])
Output needed B = [[1.16,2,1.5],[1.33,1.25,1.2]]
Code:
B= [[float(j)/float(i) for j in q] for i in r].
However, I keep getting an error : TypeError: float() argument must be a string or a number. I have imported division from future. Any suggestions?