Consider the dataset 'bush-gore-results-fl_demo.csv'. Construct 20 different samples of counties, by randomly sampling t

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Consider the dataset 'bush-gore-results-fl_demo.csv'. Construct 20 different samples of counties, by randomly sampling t

Post by answerhappygod »

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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply