QuestionQuestion

Assignment Overview
This assignment will give you some experience solving a somewhat unstructured problem.

Background
Former President Bill Clinton said in his speech to the Democratic National Convention in Charlotte:

"Since 1961, for 52 years now, the Republicans have held the White House 28 years, the Democrats 24. In those 52 years, our private economy has produced 66 million private-sector jobs. So what's the jobs score? Republicans 24 million, Democrats 42 (million)."
In the packed convention hall, it was one of the night’s biggest applause lines. Did he have his facts right? Let’s check.

Program Specifications
We’ve done a lot of initial work for you and provided the file BLS_private.csv. Data in the file are in thousands (as noted in the file). Where does this file come from? A little research shows that Clinton probably got his data from an article on bloomberg.com which got their data from the Bureau of Labor Statistics at the U.S. Department of Labor—the definitive, non-partisan source of jobs data. In the quote above you can see that he refers to private employment data (presumably “seasonally adjusted”). You then need to select the years starting in 1961. The result is an MS Excel file that can be saved in comma-separated values format (csv). (If you are mistrustful, as you should be, you could check that we are providing the correct data.)

You need data on the presidents in that time period so you must create an input file named presidents.txt for that purpose. You will have to research the presidents to gather data for this file. What data do you need? That is part of your task: you need the data so you can check Clinton’s statement, so figure it out. Also, an additional constraint is that your presidents.txt file cannot have any jobs data in it—all jobs data must come from the BLS_private.csv file. Your presidents.txt file will simply be a file of words and numbers that you can create using something like Notepad (Windows) or TextEdit (Mac).
Your task is to combine the input from both files (our BLS_private.csv and your presidents.txt) to see if you can verify Clinton’s statement. You have a number of challenges such as: what does he mean by “produced”?

What output is expected? We don’t specify that either. You need sufficient output to show that you have verified (or not) Clinton’s assertion. Simply saying “verified” (or not) is not sufficient: justify your assertion.

Since part of your task is to convince the instructor that you have in fact verified (or not) Clinton’s assertion you will need to make sure that what you are trying to do in your code is understandable, i.e. take care with your comments that they will help the reader understand what you are doing.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

from csv import reader

my_dict = {}
with open('BLS_private.csv', 'r') as read_obj:
    # pass the file object to reader() to get the reader object
    csv_reader = reader(read_obj)
    # Pass reader object to list() to get a list of lists
    list_of_rows = list(csv_reader)

    # list of months
    MMM = []
    for row in list_of_rows:
       try:
            # if the first column contains a number
            # then it is a row we want to take the data
            # for it's a year
            # we check it by convertint the first column to integer
            val = int(row[0])
            # iterate over items of this row
            col_index = 1
            while col_index < len(row):
                # add item to the dictionary
                my_dict[(row[0], MMM[col_index])] = row[col_index]
               
                col_index += 1...

By purchasing this solution you'll be able to access the following files:
Solution.zip.

50% discount

Hours
Minutes
Seconds
$14.00 $7.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Python Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats