Introduction
I am going to go for a Raymond Hettinger style presentation, https://www.cs.odu.edu/~tkennedy/cs330/s21/Public/languageResources/#python-programming-videos.
These materials are web-centric (i.e., do not need to be printed and are available at https://www.cs.odu.edu/~tkennedy/numpy-workshop).
Who am I?
I have taught various courses, including:
- CS 300T - Computers in Society
- CS 333 - Programming and Problem Solving
- CS 330 - Object Oriented Programming and Design
- CS 350 - Introduction to Software Engineering
- CS 410 - Professional Workforce Development I
- CS 411W - Professional Workforce Development II
- CS 417 - Computational Methods & Software
Most of my free time is spent writing Python 3 and Rust code, tweaking my Vim configuration, or learning a new (programming) language. My current language of interests are Rust (at the time of writing) and Python (specifically the NumPy library).
Referenced Courses & Materials
I may reference materials (e.g., lecture notes) and topics from various courses, including:
- CS 330 - Object Oriented Programming & Design
- CS 350 - Introduction to Software Engineering
- CS 417 - Computational Methods & Software
I may also reference a couple examples from the previous:
Overview
What is NumPy?
NumPy is the fundamental package for scientific computing in Python. It is a Python library that provides a multidimensional array object, various derived objects (such as masked arrays and matrices), and an assortment of routines for fast operations on arrays, including mathematical, logical, shape manipulation, sorting, selecting, I/O, discrete Fourier transforms, basic linear algebra, basic statistical operations, random simulation and much more.
Retrieved from https://numpy.org/doc/stable/user/whatisnumpy.html
We can only scratch the surface during a one (1) hour workshop.
Examples
The first few examples will be short and focus on arrays and statistics. These examples are inspired by Coffee Break NumPy by Christian Mayer.
Creating Arrays
array_size = 8
zeroes_array = np.zeros(array_size)
print(zeroes_array)
print()
array_size = 12
ones_array = np.ones(array_size)
print(ones_array)
print()
# Contents are "whatever happens to be in memory"
array_size = 16
unitialized_array = np.empty(array_size)
print(unitialized_array)
print()
python_list = [2, 4, 8, 16, 32, 64]
np_array = np.array(python_list)
print(np_array)
print()
python_list = [2., 4., 8., 16., 32., 64.]
np_array = np.array(python_list)
print(np_array)
print()
I/O
Indexing
Index Arrays
Boolean (Mask) Index Arrays
Broadcasting
Linear Algebra
Statistics