We Love Python
Ethical Data Science
Getting and Cleaning the Data
Getting Statistics
Plotting Data and Sharing Results
100

import pandas as pd, what exactly is pd?

An alias/nickname so you don't have to type pandas every time

100

Names, addresses, birthdates, biometrics are referred to as what acronym?

PII, personally identifiable information

100

The value pandas uses to mark missing data once a file is loaded.

NaN (from np.nan; None also)

100

In y = mx + b language: β1 is the ___, β0 is the ___.

Slope (coefficient) and intercept

100

What is the matplotlib call that drops a vertical line at x = 2020?

ax.axvline(2020)

200

Your co-worker is attempting to create a new column called 'data science' in their Python DataFrame called codeworks, but they keep getting an error when they run this, why?

codeworks[data science] = 

no quotes around data science/new column name

codeworks['data science'] =

200

Ethics shows up at four points in a project, what are they? Extra 500: Annotators labeled friendly AAVE tweets as toxic; the model now flags them at 90%+. Which checkpoint failed, and why does the model keep repeating the mistake?

The team, the data, the analysis, and after the algorithm. Extra 500: The data: biased human labels; any bias in the data is perpetuated by the model

200

Maryland masks cells with asterisks, NYC uses 's'; how would I make this column numeric? Simultaneously making these values blank.

pd.to_numeric(col, errors="coerce")

200

smf.ols("Circumference ~ Height", data=trees) — which variable is the outcome Y?

Circumference: the left side of the ~ is always the dependent variable

200

The class put project code here for the world to see; and sending your saved changes up to it is called this. Bonus 300 points: The file at the top of every repository that tells a stranger reading your respository what the project is and how to run it.

GitHub; pushing changes. Bonus: the READMe file.

300

.loc selects by ___, while .iloc selects by ___ counting from 0.

label; integer position

300

Analyzing Maryland entrepreneurs? Our lecture said your team should include this.

Someone from that community/a Maryland entrepreneur

300

What do we call it when every variable is a column, every observation is a row, every value its own cell.

Tidy data

300

Height's coefficient is 0.256 with P>|t| of 0.003. Is this significant at 0.05? And what does 0.256 mean in words?

Yes. Each 1-unit increase in height predicts about +0.256 circumference.

300

From our code-along: hide the top and right edges of the plot box, how?

sns.despine()

400

When do df.loc[2, "income"] and df.iloc[2, 1] return the very same value?

When label 2 sits at position 2 (fresh 0,1,2,… index; nothing filtered or re-sorted) and income is column position 1

400

After IBM's face dataset was used in ways people never consented to, what happened

People sued, the dataset came down, companies halted police sales

400

Which of these is the result of pd.merge(df_a,df_b,on='sample', how='right')

C

400

Comparing mean pain levels across three painkiller groups calls for this test (bonus 200 points: tell me its not-normal cousin).

ANOVA (Kruskal–Wallis if the data aren't normal)

400

Best figure for counts of one categorical variable; best figure for a value over time.

Bar chart; line plot

500

How would you flip the coordinates on a histogram?

plt.hist(orientation='horizontal') OR

plt.hist(orientation='vertical')

500

Ethical data science improves lives and avoids harm; just data science does what?

Improves the lives of the least well-off and encourages data sovereignty for those same groups

500

The same song appears five times from five releases. The two methods that when run back to back would keep only the most popular copy before a join.

sort_values("popularity", ascending=False) then drop_duplicates(...)

500

Age drives both shoe size and literacy. The name for age's role here, and one way regression deals with it.

A confounder. Add it as a control in multiple regression: literacy ~ shoe_size + age

500

What three things should a presentation do?

Inspire, educate, and entertain

M
e
n
u