CSE 163
Data Literacy�
Suh Young Choi�
🎶 Listening to: Across the Spider-Verse Soundtrack
💬 Before Class: What parallel universe would you like to live in?
Last Time
This Time
2
Announcements
3
MultiIndex�Recap
Filtering on a MultiIndex requires .loc with a tuple for the row indexer
4
# MultiIndex of (year, month, day)
# returns count for one day
earthquakes.loc[(2016, 7, 27), “count”]
# returns count for all days
earthquakes.loc[:, “count”]
# returns count for multiple days in the same year/month
earthquakes.loc[(2016, 7, slice(10, 15)), “count”]
# returns count for multiple months
earthquakes.loc[(2016, [7, 8], 27), “count”]
Does code tell us anything about data?��Sometimes!
5
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
data = pd.read_csv('home/data.csv')
data = data[['name', 'fin_length', 'age']]
data = data.dropna()
sns.relplot(data=data, kind='line', x='age’, y='fin_length', hue='name')
plt.title('Shark Ages vs. Fin Length')
plt.xlabel('Age (months)')
plt.ylabel('Fin Length (in)')
plt.savefig('/home/plot.png')
suggests >3 columns
suggests missing values
suggests quantitative and categorical variables
Data Context Guiding Questions
6
Where do we find context?
7
Data Storytelling
Let’s talk about parallel universes…
8
Shark Multiverse…
9
Narrative Plot Mountain
10
Exposition
Rising Action
Climax
Falling action
Resolution
Data Story Plot Mountain
11
Finding data
Posing research
questions
Pre-processing
Coding
Analysis to answer questions
Testing
Visualizations
Writing
reports
Interpreting results
Presenting
findings
Communications
Finding Main Characters
12
Writing Tips
13
Avoiding the Vacuum
Interpret any numbers and/or trends in context!
Do NOT leave free-floating numbers. ☹ (If you do, Suh Young will be a bit sad.)
Do not assume that your reader knows your code as well as you do! (For in-class assignments, you may assume that your reader knows any definitions that we give in the spec.)
Think about explaining your project/portfolio to someone who is not in this class.
14
Sentence-�Level Details
A few mechanical things to think about:
15
Key Takeaways
Think about how your analysis might be used or interpreted
Consider biases in your data and analysis—even the ones that might come from you!
Consider the impact, ethics, and consequences of your analysis
Data science tells a story—who is our “main character”, and what do we want to focus on?
16
Group Work:
Best Practices
When you first working with this group:
Tips:
17
Next Time
Before Next Time
18