Consider the dataset 'bush-gore-results-fl_demo.csv'. Construct 20 different samples of counties, by randomly sampling t
Posted: Wed Apr 27, 2022 3:44 pm
Consider the dataset 'bush-gore-results-fl_demo.csv'. Construct
20 different samples of counties, by randomly sampling the 10 out
of the 50 rows. For each sample, calculate the total votes received
by each specified candidate, and return the average across the 20
samples for each candidate.
Unless specified otherwise, use the sample() function in pandas
and set the 'random_state' parameter to the ith sample number to
faciliate testing, i.e., for the fist sample use random_state=0,
for the second sample use random_state=1, etc.
(a) Using sampling with replacement, create samples for
following candidates: ['brow', 'nade', 'harr', 'hage', 'buch',
'mcre', 'phil', 'moor'], and return the mean of the total votes for
each candidate.
20 different samples of counties, by randomly sampling the 10 out
of the 50 rows. For each sample, calculate the total votes received
by each specified candidate, and return the average across the 20
samples for each candidate.
Unless specified otherwise, use the sample() function in pandas
and set the 'random_state' parameter to the ith sample number to
faciliate testing, i.e., for the fist sample use random_state=0,
for the second sample use random_state=1, etc.
(a) Using sampling with replacement, create samples for
following candidates: ['brow', 'nade', 'harr', 'hage', 'buch',
'mcre', 'phil', 'moor'], and return the mean of the total votes for
each candidate.