Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning SciPy for Numerical and Scientific Computing Second Edition
  • Table Of Contents Toc
Learning SciPy for Numerical and Scientific Computing Second Edition

Learning SciPy for Numerical and Scientific Computing Second Edition - Second Edition

4.3 (10)
close
close
Learning SciPy for Numerical and Scientific Computing Second Edition

Learning SciPy for Numerical and Scientific Computing Second Edition

4.3 (10)

Overview of this book

This book targets programmers and scientists who have basic Python knowledge and who are keen to perform scientific and numerical computations with SciPy.
Table of Contents (10 chapters)
close
close
9
Index

Univariate polynomials

Polynomials are defined in SciPy as a NumPy class, poly1d. This class has a handful of methods associated to compute the coefficients of the polynomial (coeffs or simply c), to compute the roots of the polynomial (r), to compute its derivative (deriv), to compute the symbolic integral (integ), and to obtain the degree (order or simply o), as well as a method (variable) that provides a string holding the name of the variable we would like to use in the proper definition of the polynomial (see the example involving P2).

In order to define a polynomial, we must indicate either its coefficients or its roots:

>>> import numpy
>>> P1=numpy.poly1d([1,0,1])           # using coefficients
>>> print (P1)

The output is as follows:

   2
1 x + 1

Now let's find roots, order, and derivative of P1:

>>> print (P1.r); print (P1.o); print (P1.deriv())

The output is as follows:

[ 0.+1.j  0.-1.j]
2
2 x

Let's use the poly1d class:

>>> P2...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learning SciPy for Numerical and Scientific Computing Second Edition
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon