def expand_by_minors_on_row(self, row):
		"""Calculates the determinant by expansion of minors

		This function returns the determinant of the matrix by doing an
		expansion of minors on the specified row.
		"""
		assert(row < self.rows())
		d = 0
		for col in xrange(self.cols()):
			# Note: the () around -1 are needed.  Otherwise you get -(1**col).
			d += (-1)**(row+col)* \
				self[(row, col)]*self.minor(row, col).determinant()
		return d
Calculates the determinant by expansion of minors

		This function returns the determinant of the matrix by doing an
		expansion of minors on the specified row.
		
recipes/Python/189971_Basic_Linear_Algebra_Matrix/recipe-189971.py