PIC 1: From Spreadsheets to Programming and Data Science
About
This course begins with computer fundamentals such as saving and retrieving files in an organized way, essential skills for almost everyone's personal and professional life.
Next, spreadsheets are used to introduce core coding concepts like data types, syntax, and functions. A study of spreadsheets is independently valuable because they are used in a variety of careers and education settings for data collection, presentation, manipulation, and analysis. In this course, we use data analysis tools like curve fitting, pivot tables, and weighted averages.
The course concludes with a four-to-five week, down-to-earth introduction to the Python programming language. Students are introduced to algorithmic thinking and key coding concepts like control flow and functions. The goal is for everyone to leave the class with a good sense of what programming is about. This course gives a gentle introduction to programming that encourages participation in other courses like PIC 16A.
Course Description
Lecture, three hours; discussion, two hours. No programming experience assumed. Essential computer knowledge (files, file extensions, directories, paths, ZIP archives, saving and retrieving files, a programming-suitable text editor); introduction to fundamental coding concepts in Desmos Graphing Calculator and Google Sheets (datatypes, calculations, formulae, syntax, variables, functions, error messages); data analysis using Desmos Graphing Calculator and Google Sheets (curve fitting with constraints, sorting data, filtering data by value and conditions, conditional formatting, pivot tables, weighted averages, language analysis, data visualization); programming in Python; variables, assignments, datatypes (int, float, bool, string, list), arithmetic, comparisons, logical connectives, indexing; built-in functions, math and random functions; control flow (if, for, while); functions, methods; list comprehension; brief exposure to Python libraries (pillow, matplotlib, scipy). P/NP or letter grading.
Learning Objectives / Competencies
After successful completion of PIC 1, students should be able to...
- Save and retrieve files in an organized way.
- Use a text editor for quick and efficient editing of text files and code.
- Provide an example of using pivot tables to perform data science.
- Pay attention to subtleties when typing mathematical formulae in coding languages and successfully correct syntax errors.
- Choose a good datatype for solving a given problem.
- Use variables to store and update values of algorithmic importance.
- Index strings and lists confidently and correctly.
- Patiently read error messages to attempt to better understand the problem encountered.
- Write and use functions to avoid the unnecessary repetition of code.
- Implement, test, and debug short algorithms involving simple control flow.
- Identify a useful application of one of the Python libraries they have used.
Schedule of Lectures / Course Outline
Lectures 1-4: File Management
- Files, file extensions, directories, and paths.
- ZIP Archives - zipping and unzipping.
- Downloading, searching for, and renaming files.
- Using a text editor suitable for programming.
- The surprising power of "find and replace".
- Submitting work for an autograder.
Lectures 5-9: Desmos Graphing Calculator
-
Data analysis via curve fitting (regression).
- Explicit linear and quadratic curves.
- Implicit curves like circles and ellipses.
- Using constraints to match data appropriately.
- Solving scientific problems with these techniques.
-
Introduction to fundamental coding concepts.
- Performing calculations with code.
- Entering provided mathematical formulae correctly.
- Using variables and naming variables carefully.
- An introduction to the importance of syntax via Desmos' use of = and ~.
- Abiding by the rules of the language which reserves x and y for a particular usage.
- Understanding error messages.
Lectures 10-17: Spreadsheets
-
Efficient data analysis via basic techniques, filters, and pivot tables.
- Sorting data.
- Conditional formatting.
- Filtering by values and conditions.
- Using suggested pivot tables.
- Customizing pivot tables.
- Grouping with pivot tables.
- Filtering pivot tables.
- An appreciation that presenting the same data differently can lead one to many conclusions.
-
Introduction to fundamental coding concepts.
- Datatypes, their different purposes, benefits, and deficiencies.
- Entering provided mathematical formulae correctly to operate on cell values.
- An introduction to the importance of syntax via Google Sheets' use of $ which allows one to correctly extend a formula to a collection of formulae in a row or column.
- Using functions.
- Generating mathematical data.
- Understanding error messages.
-
Attacking mathematical, scientific, and data presentation problems using spreadsheets.
- Calculating weighted averages.
- Resolving the authorship of documents through language analysis.
- Producing graphics that maximize the visible information for a competitive race.
Lectures 18-28: Programming in Python
- Variables and assignment (=)
-
Python datatypes and associated functionality
-
int and float
- arithmetic
- floating point imprecision
- comparisons (including ==)
-
bool
- logical connectives (not, and, or)
-
strings and lists
- indexing containers
- concatenation
- dictionaries and sets (optional)
-
int and float
-
Built-in functions
- len
- min, max, sum
- sorted
- round
-
Math and Random functions
- floor, ceil
- random, randint, choice
-
Control flow
- if, else, elif
- for loop over the elements in a container
- for loop using indices with range
- while loop
- Functions and Methods
- List Comprehension
-
Brief exposure to Python libraries
- Drawing images with Pillow
- Plotting with Matplotlib
- Curve fitting with Scipy
Expected Grade Scheme and Homework Assignments
- At least eight homework assignments: 30%
- Midterm 1: 20%
- Midterm 2: 20%
- Final: 30%
Since this is an introductory class in which students often rely on homework assignments to reinforce their lecture learning in a timely manner, PIC 1 instructors are required to assign at least eight homework assignments.