Python Reading
Key Ideas
- NumPy is Python library written in C to provide fast numerical
methods for scientific computation.
- NumPy enables Python users to use a data structure
called an array. You can conceptualize an array as an
efficient implementation of a list.
- Today we will see examples of 1-D (one dimensional)
and 2-D (two dimensional) arrays.
However, Python arrays can contain any number of dimensions.
Getting Started
- Install NumPy on your machine:
- Windows: python -m pip install numpy
- Mac: pip3 install --user numpy
In-Class Activity
- One way to gain insight into numeric data is to calculate
its mean and standard deviation. More information.
- Sometimes it is useful to sort numeric data into either
ascending or descending order. Why?
- Download demo.py and
conduct experiments until you fully understand it.
- Can you explain how the sort function works?
- The sort function does not return anything.
Why does the shoulder_heights array in the main program change?
- Can you modify the sort function so that it sorts the
data into descending order?
- The NumPy module includes a sort function. Can you find
the relevant documentation and then use it?
- What are other useful things you might want to do with
a 1-D array?
Active Learning
Optional, Advanced Windows Path Variable Information