Book Image

NumPy: Beginner's Guide

By : Ivan Idris
Book Image

NumPy: Beginner's Guide

By: Ivan Idris

Overview of this book

Table of Contents (21 chapters)
NumPy Beginner's Guide Third Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
NumPy Functions' References
Index

Summary


We calculated the correlation of the stock returns of two stocks with the corrcoef() function. As a bonus, we demonstrated the diagonal() and trace() functions, which can give us the diagonal and trace of a matrix.

We fit data to a polynomial with the polyfit() function. We learned about the polyval() function that computes the values of a polynomial, the roots() function that returns the roots of the polynomial, and the polyder() function, which gives back the derivative of a polynomial.

We saw that the full() function fills an array with a number, and the full_like() function uses the metadata of an input array to create a new array. Both functions allow you to specify the data type.

Hopefully, you have increased your productivity, so that we can continue in the next chapter with matrices and Universal Functions (ufuncs).