[Python] showing 2 raised to the power of a fractional argument in sympy

Discussão em 'Python' iniciado por Stack, Julho 8, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to display 2^{\frac{1}{12}} in a jupyter notebook using the following Python code:


    from sympy import *

    pow(2,Rational(1, 12))


    which gives me

    [​IMG]

    but I'd rather have

    2 raised to the power of 1/12 (sorry have no quick way to display this symbolically here.

    Continue reading...

Compartilhe esta Página