[Python] What is the equivalent of np.polyval in the new np.polynomial API?

Discussão em 'Python' iniciado por Stack, Outubro 24, 2024.

  1. Stack

    Stack Membro Participativo

    I can't find a direct answer in NumPy documentation. This snippet will populate y with polynomial p values on domain x:

    p = [1, 2, 3]
    x = np.linspace(0, 1, 10)
    y = [np.polyval(p, i) for i in x]


    What is the new API equivalent when p = Polynomial(p)?

    Continue reading...

Compartilhe esta Página