CS 371: Module 2: Classes Part 1

Module content developed by Professor Tralie. Module engine developed by Professor Tralie and Professor Mongan.

Please watch the video below, and click the Next button to continue when you're finished


  • numpy, or "numerical python," is a library that's used to store numerical lists called numpy arrays, and it has a lot of useful methods for manipulating arrays
  • Numpy's arange method can be used to make an array of sequential numbers
  • Numpy's random.randn method can be used to generate an array of random numbers sampled from a Gaussian distribution with mean 0 and standard deviation 1.
  • Numpy's zeros method can be used to initialize an array with zeros.
  • matplotlib is a python plotting library that works in synergy with numpy, and it allows us to plot numpy arrays. For example, you can plot a stem plot with plt.stem, a regular line plot with plt.plot, and a histogram with plt.hist.