Polynomial mathematics

NumPy also provides methods to work with polynomials, and includes a package called numpy.polynomial to create, manipulate, and fit the polynomials. A common application of this would be interpolation and extrapolation. In this section, our focus is still on using ndarray with NumPy functions instead of using polynomial instances. (Don't worry, we will still show you the usage of the polynomial class.)

As we stated in the matrix class section, using ndarray with NumPy functions is preferred since ndarray can be accepted in any functions while matrix and polynomial objects need to be converted, especially when communicating to other programs. Both of them provided handy properties, but in most cases ndarray would be good enough. ...

Get NumPy Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.