(m, **options)
Convert a sympy/scipy.sparse matrix to a numpy matrix.
Convert a sympy/scipy.sparse matrix to a numpy matrix.
Convert a sympy / scipy . sparse matrix to a numpy matrix .
def to_numpy(m, **options):
    """Convert a sympy/scipy.sparse matrix to a numpy matrix."""
    dtype = options.get('dtype', 'complex')
    if isinstance(m, (Matrix, Expr)):
        return sympy_to_numpy(m, dtype=dtype)
    elif isinstance(m, numpy_ndarray):
        return m
    elif isinstance(m, scipy_sparse_matrix):
        return m.todense()
    raise TypeError('Expected sympy/numpy/scipy.sparse matrix, got: %r' % m)
def to_numpy ( m , * * options ) : dtype = options . get ( 'dtype' , 'complex' ) if isinstance ( m , ( Matrix , Expr ) ) : return sympy_to_numpy ( m , dtype = dtype ) elif isinstance ( m , numpy_ndarray ) : return m elif isinstance ( m , scipy_sparse_matrix ) : return m . todense ( ) raise TypeError ( 'Expected sympy/numpy/scipy.sparse matrix, got: %r' % m )