Hi Mateusz, I think I understand but ...
On Apr 19, 12:13 pm, Mateusz Paprocki <[email protected]> wrote: > They look identical, but they're not. As you use F.as_dict(), then in > both cases c_i are of type Integer. However, keys of _50 and _51 are > different. In _50 M_i are tuples of Integer instances and in _51 they > are tuples of ints. When you created a Matrix of FF then FF got sympified > and all ints were converted to Integers. Poly, however, expects M_i to > have int exponents. To solve this problem you can replace dict(M[0,0]) > with: > > dict([ (map(int, monom), coeff) for monom, coeff in M[0,0] ]) this results in an error In [12]: dict([ (map(int, monom), coeff) for monom, coeff in M[0,0] ]) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /tmp/mattpap-sympy-polys-cd30a32/<ipython console> in <module>() TypeError: list objects are unhashable Maybe you meant something slightly different? Or is it another Python 2.5 vs 2.6 thing? Thanks, Ben -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
