First page Back Continue Last page Overview Graphics

Expenditure per Person

>>> PersQuantity = np.array([[100,175,210],[90,160,150],[200,50,100],[120,0,310]])

>>> Price_per_100_g = np.array([2.98,3.90,1.99])

>>> Preis_in_Cent = np.dot(PersQuantity,Price_per_100_g)

>>> Price_in_Euro = Price_in_Cent / np.array([100,100,100,100])

>>> Price_in_Euro

array([ 13.984, 11.907, 9.9 , 9.745])

>>>

This means, that Lukas had to pay 13.98 €, Mia 11.97, Leon 9.90 and Hannah 9.75.