Lesson 11: Python Basics, Lists, Functions and Packages
February 21, 2018
Review:
- Intro to Python for Data Science
- DataCamp
Presentation:
- Review Chapters 1-2
- Variables
- Initializing and Modifying
- Types
- Numeric: float, integer
- Non-numeric: string, boolean (true/false)
- Conversion
- Lists
- Like arrays or spreadsheets (think rows and columns as indices)
- Store and process data with attributes
- methods like append(), remove() to modify lists
- Variables
- Preview Chapters 3-4
- Functions
- print(), type()
- str(), int(), float(), bool()
- many, many others
- Packages
- NumPy
- import statement (e.g., import numpy as np)
- numpy functions (e.g., mean, median, std, corrcoef; use by calling np.mean(name of array)
- thousands of others
- NumPy
- Functions
Assignment:
- Intro to Python for Data Science
- Ch. 3: Functions and Packages (due today)
- Ch. 4: NumPy (due tomorrow)