11. Prepare for MSE 3114 next semester!#

Learning Objectives

  • Be able to use python next semester in MSE 3114 with minimal startup time.

11.1. Lesson#

Having a good cheatsheet is particularly important to your continual use of python and will be especially appreciated as you work through MSE 3114 next semester. At a minimum I would make sure your cheatsheet includes the topics listed below. I would heavily use markdown cells and section / subsection text to organize your cheatsheet.

  • run jupyter and open a notebook

  • use markdown cells for (see chapter 2)

    1. commenting

    2. formatting equations (see chap 6.17)

    3. displaying images or screen clips

  • be able to write functions

  • be able to write basic loops: if elif else for (see chapter 1.6)

  • use list comprehensions to perform repeating tasks; generating a list of results (see chap 1.7)

  • convert lists to numpy arrays

  • be able to read csv and excel files from both a path in your own directory and directly from google drive given the file id

  • be able to take a dataframe and clean up the data:

    1. find the column types i.e. object, float, integer, etc.

    2. convert a column of type object that contains numbers (and missing data) to numeric

    3. drop columns that contain no values

    4. drop rows that are missing at least one column entry

  • be able to create new columns based on existing columns

  • be able to rename column headers

  • be able to slice a dataframe to take multiple columns and/or rows e.g. iloc[] and loc[]

  • be able to select rows in a dataframe based on conditionals (see chap 9.3.1)

  • be able to plot data from the dataframe

  • use groupby() on a dataframe along with .mean(), .count(), .sum(), etc

  • be able to fit data using curve_fit from scipy.optimize (see chapter 3.5)

  • know when to use linspace() vs geomspace()

  • plotting data using matplotlib.pyplot

    1. scatter plots

    2. add text annotations

    3. add vertical and horizontal lines

    4. change symbol type and color

    5. change line type and color

    6. add axis labels and plot title

    7. use equation formatting and greek letters in axis labels (see chap 5.1)

  • using advanced layouts for multiple plot

11.2. Exercises#

11.2.1. Problem 1#

Work on updating your cheatsheets. Keep in mind what you are most likely to forget by next semester and make yourself a note in the cheatsheet. Keep in mind the topics I outlined above. Include those you will most likely forget how to do. Flip through the online text to remind yourself of topics and examples that you may need in 3114.

(1) Turn in your cheatsheet.