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”])
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”])