Smart solution. Thank you.
On Thursday, April 2, 2015 at 12:10:38 PM UTC+3, Francesco Bonazzi wrote:
>
> In [1]: var('x y', positive=True)
> Out[1]: (x, y)
>
> In [2]: ex = x**2 * y**4
>
> In [3]: w = Wild('w')
>
> In [4]: mt = ex.match(w**2)
>
> In [5]: mt
> Out[5]:
> ⎧ 2⎫
> ⎨w: x⋅y ⎬
> ⎩ ⎭
>
> In [6]: Pow(mt[w], 2, evaluate=False)
> Out[6]:
> 2
> ⎛ 2⎞
> ⎝x⋅y ⎠
>
>
>
>
> On Tuesday, March 31, 2015 at 4:50:59 PM UTC+2, Paul Royik wrote:
>>
>> Is there any way I can rewrite
>> x^2y^4 to (xy^2)^2 or x^3(x+y)^6 to (x(x+y)^2)^3
>>
>>
>> , i.e. combine base?
>>
>>
>> Exponents are guaranteed to be integers.
>>
>>
>> Thank you.
>>
>
--
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/798ea740-593b-400e-980b-8ae81c591a16%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.