CH 2 1 Python PDF
CH 2 1 Python PDF
Python Lists
Intro to Python for Data Science
Problem
● Data Science: many data points
● Height of entire family
● Inconvenient
Intro to Python for Data Science
In [9]: fam
Out[9]: [1.73, 1.68, 1.71, 1.89]
In [11]: fam
Out[11]: ['liz', 1.73, 'emma', 1.68, 'mom', 1.71, 'dad', 1.89]
["liz", 1.73]
["emma", 1.68]
["mom", 1.71]
["dad", 1.89]
Intro to Python for Data Science
In [11]: fam
Out[11]: ['liz', 1.73, 'emma', 1.68, 'mom', 1.71, 'dad', 1.89]
In [12]: fam2
Out[12]: [['liz', 1.73], ['emma', 1.68],
['mom', 1.71], ['dad', 1.89]]
Intro to Python for Data Science
List type
In [13]: type(fam)
Out[13]: list
In [14]: type(fam2)
Out[14]: list
● Specific functionality
● Specific behavior
INTRO TO PYTHON FOR DATA SCIENCE
Let’s practice!