Question: Take this file as input: state_population.csv ( I cant upload the file so I took a picture of the numbers) Use the population

Take this file as input: state_population.csv  ( I cant upload the file so I took a picture of the numbers) 

 

 

Use the population field as the datapoint to select your sample.

Set the margin of error (.01, .05, .10)

Calculate the following summary statistics for the selected field:

  1. Count, Min, Max, and Standard Deviation
  2. Sample Size at 80%, 85%, 90%, 95%, 99% confidence using .01, .05, .10 margin of error respectively
  • Note use .5 standard deviation instead of the actual standard deviation to calculate the sample size

Create test data file(s) that contain the number of values specified by the sample size; however, these files must contain records that include max and min of the selected data point from the original data set.

Output test data files to the output directory called "sample_files_output"

Your program should output 15 different files using the naming convention

  1. sample_data_confidenceInterval_marginError_recordCount.csv:
    • For example (counts are accurate):
      1. sample_data_number_1.28_0.1_22.csv
      2. sample_data_number_1.28_0.01_51.csv
      3. sample_data_number_1.28_0.05_39.csv
      4. sample_data_number_1.44_0.1_25.csv
      5. sample_data_number_1.44_0.01_51.csv
      6. sample_data_number_1.44_0.05_41.csv
      7. sample_data_number_1.65_0.1_29.csv
      8. sample_data_number_1.65_0.01_51.csv
      9. sample_data_number_1.65_0.05_43.csv
      10. sample_data_number_1.96_0.1_33.csv
      11. sample_data_number_1.96_0.01_51.csv
      12. sample_data_number_1.96_0.05_45.csv
      13. sample_data_number_2.58_0.1_39.csv
      14. sample_data_number_2.58_0.01_51.csv
      15. sample_data_number_2.58_0.05_48.csv


state,pop
Montana,1041732.0
Oklahoma,3918137.0
Delaware,949495.0
Arizona,6946685.0
Florida,20598139.0
Alabama,4864680.0
Utah,2203366.0
Michigan,9957488.0
North Carolina,10155624.0
Virginia,8413774.0
Rhode Island,1056611.0
Vermont,624977.0
Alaska,736384.0
Kansas,2908776.0
Wyoming,581836.0
District of Columbia,684498.0
Iowa,3132499.0
Idaho,1687809.0
New Hampshire,1343622.0
New Jersey,8881845.0
Maryland,6003435.0
North Dakota,752201.0
Hawaii,1421954.0
South Dakota,864289.0
Massachusetts,6801779.0
Tennessee,6651089.0
Illinois,12821497.0
Kentucky,4440204.0
Puerto Rico,3386941.0
California,39148760.0
Wisconsin,5778394.0
Georgia,10297484.0
Mississippi,2988762.0
New Mexico,2092434.0
Oregon,4081943.0

 





state,pop Montana, 1041732.0 Oklahoma, 3918137.0 Delaware, 949495.0 Arizona, 6946685.0 Florida, 20598139.0 Alabama,

state,pop Montana, 1041732.0 Oklahoma, 3918137.0 Delaware, 949495.0 Arizona, 6946685.0 Florida, 20598139.0 Alabama, 4864680.0 Utah, 2203366.0 Michigan, 9957488.0 North Carolina, 10155624.0 Virginia, 8413774.0 Rhode Island, 1056611.0 Vermont, 624977.0 Alaska, 736384.0 Kansas, 2908776.0 Wyoming, 581836.0 District of Columbia, 684498.0 Iowa, 3132499.0 Idaho, 1687809.0 New Hampshire, 1343622.0 New Jersey, 8881845.0 Maryland, 6003435.0 North Dakota, 752201.0 Hawaii, 1421954.0 South Dakota, 864289.0 Massachusetts, 6801779.0 Tennessee, 6651089.0 Illinois, 12821497.0 Kentucky, 4440204.0 Puerto Rico, 3386941.0 California, 39148760.0 Wisconsin, 5778394.0 Georgia, 10297484.0 Mississippi, 2988762.0 New Mexico,2092434.0 Oregon, 4081943.0 Minnesota, 5527358.0 Louisiana, 4663616.0 Connecticut, 3581504.0 New York, 19618453.0 Maine, 1332813.0 Pennsylvania, 12791181.0 Texas, 27885195.0 West Virginia, 1829054.0 Ohio, 11641879.0 Indiana, 6637426.0 Missouri, 6090062.0 Nevada, 2922849.0 Arkansas, 2990671.0 South Carolina, 4955925.0 Colorado, 5531141.0 Nebraska, 1904760.0 Washington, 7294336.0

Step by Step Solution

3.52 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Code Unix Terminal cat salespy usrlocalbinpython3 def main reading file with openboroughsalescsv as ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!