data sampling and probability Flashcards

1
Q

What percentage of Gotham voters are planning to vote for the Democratic candidate?

A

100 * np.mean(gotham[“vote.dem”])

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Suppose we take a convenience sample of everyone who is retired?

A

convenience_sample = gotham.query(“age >= 65”)

100 * np.mean(convenience_sample[“vote.dem”])

How well did you know this?
1
Not at all
2
3
4
5
Perfectly