#NEWLINE# def matrix2numpy( m , dtype = object ) : #NEWLINE# #INDENT# "Converts SymPy's matrix to a NumPy array.\n\n    See Also\n    ========\n\n    list2numpy\n    " #NEWLINE# from numpy import empty #NEWLINE# a = empty ( m . shape , dtype ) #NEWLINE# for i in range ( m . rows ) : #NEWLINE# #INDENT# for j in range ( a . cols ) : #NEWLINE# #INDENT# a [ ( i , j ) ] = m [ ( i , j ) ] #NEWLINE# #UNINDENT# #UNINDENT# return a