Thank you all of you. Thank you so much. Michał Pawłowski
wtorek, 23 lutego 2021 o 00:24:08 UTC+1 [email protected] napisał(a): > Hi! > > I knew my code was bad, but not so bad. Hahaha! I just wish I could remove > my message from the archive... > > Sorry for the noise. > > Javier > > El 22 feb 2021, a las 19:26, Javier Arántegui <[email protected]> > escribió: > > > > Hi! > > I don’t know if Sympy has a method to do it. The truth is I don’t know > much. > > Using my limited knowledge I wrote a function to do it. I’m sure that it > can be improve a lot but it works: > > - - - - - > def newpoly(coefs): > p = "" > for i in range(len(coefs)): > p += str(coefs[i]) + '*x**' + str(len(coefs)-i-1) + '+' > p = p[:-1] > return sympify(p) > > newpoly([4,8,3]) > - - - - - > > Javier > > El 22 feb 2021, a las 16:39, Michał Pawłowski <[email protected]> > escribió: > > Thank you so much. But is it also possible to get formula from such array? > > I.e. > getFormula("[2, 0, 2]") > 2*x**2+2 > > Thanks > Mike > > poniedziałek, 22 lutego 2021 o 12:56:57 UTC+1 [email protected] > napisał(a): > >> Hi! >> >> Poly(4*x**2+8*x+4).all_coeffs() >> >> Javier >> >> El 22 feb 2021, a las 12:44, Michał Pawłowski <[email protected]> >> escribió: >> >> Hi. >> >> >> I'd like to get polynomial qualifiers returned as array, in example: >> >> getQualifiers("4*x**2+8*x+4") >> [4, 8, 4] >> >> or >> >> getQualifiers("4*x**2+4") >> [4, 0, 4] >> >> Is it possible? >> >> Thanks >> Mike >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sympy" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/sympy/51ffa1bd-3654-40b5-a1c2-dc650b277222n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/sympy/51ffa1bd-3654-40b5-a1c2-dc650b277222n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >> -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/1653484a-a2b8-4d6b-882f-b8c6e96b15e2n%40googlegroups.com > > <https://groups.google.com/d/msgid/sympy/1653484a-a2b8-4d6b-882f-b8c6e96b15e2n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/8921a243-0c3c-462a-90a7-4f74928ff964n%40googlegroups.com.
