79215257

Date: 2024-11-22 13:52:48
Score: 1
Natty:
Report link

What you are describing is polynomial addition, that is implemented as numpy.polynomial.polynomial.polyadd:

>>> from numpy.polynomial.polynomial import polyadd
>>> a = [0, 10, 20, 30]
>>> b = [20, 30, 40, 50, 60, 70]
>>> polyadd(a, b)
array([20., 40., 60., 80., 60., 70.])

Numpy has a whole module for such infinite dimensional vector operations: numpy.polynomial.

Just make sure to not use numpy.polyadd from the legacy numpy.poly1d package, as they treat the order of coefficients in reversed order.

Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): What you are
  • Low reputation (1):
Posted by: Sebig3000