This book introduces Python programming, basic statistics, and data visualization. It is written for an audience of first-year undergraduate students with no previous programming experience. Specifically, it is used in the Measuring Up sections of Lewis & Clark College's first-year quantitative seminar Numbers, taught by Peter Drake and Liz Stanhope.
More advanced readers will know that there are more concise, efficient, or Pythonic ways to do things. We have placed more emphasis on using a minimal set of tools to make the material more accessible.
- The Interactive Console
- Arithmetic Operators
+-*/** - Defining a Variable
= - Writing a Python Program
- The
printFunction - The List Data Type
[] - The String Data Type
''"" - The
mathLibrary - Observational Units and Variables
- The
matplotlib.pyplotLibrary - About Bar Charts
- About Histograms
- About Line Plots
- About Scatter Plots
- The
lenFunction - The
sumFunction - The Mean (Average) of a List of Numbers
- Defining a Function
def - The
sortedFunction - Getting a Sequence Element at a Specific Index With
[] - Testing Equality
== - Making a Decision
if - Integer Division
//% - The Median (Middle Value) of a List of Numbers
- Counting Occurrences
count - The Mode (Most Common Value) of a List of Numbers
- List Comprehensions
- Type Conversion
intfloatliststrbool - Reading Data From a File
csv - About Outliers
- The Range of a List of Numbers
- Percentiles and Quartiles (Dividing up the Data)
- The Interquartile Range (Range of the Middle Half of the Data)
- About Box Plots
- Standard Deviation (Sophisticated Measure of Spread)
- Distributions
- The Set Data Type
{} - Plotting a Frequency Bar Chart
- Dealing With Missing Data
- Testing Membership
in - Combining Lists
zip - Slicing Sequences
[:]
- Proportions
- Populations and Samples
- The Empirical Rule for Normal Distributions
- Samping Distributions
- The Central Limit Theorem for Proportions
- 95% Confidence Intervals
- Correlation
- Regression