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

Time for action – plotting the Bartlett window


The Bartlett window is a triangular smoothing window:

  1. Call the NumPy bartlett() function:

    window = np.bartlett(42)
  2. Plotting is easy with matplotlib:

    plt.plot(window)
    plt.show()

    The following is the Bartlett window, which is triangular, as expected:

What just happened?

We plotted the Bartlett window with the NumPy bartlett() function.