
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Trying to write a bash script off of a CSV file. The script will be given a single argument. If the argument is a year, the program should report the country with the highest incidence and the corresponding incidence value for that year. On the other hand, if the argument is a country, the program should report the year with the highest incidence and the corresponding incidence value.
For example if
./script.sh Afghanistan is given the output will show that the year 2018 had the highest births with a skilled personnel at 58.8%
or if
./script.sh 2018 is given the output will show that the country Albania had the highest births with a skilled personnel at 99.8%
The CSV file looks as follows
Afghanistan | 2018 | Births attended by skilled health personnel (%) | 58.8 |
Afghanistan | 2017 | Births attended by skilled health personnel (%) | 53.4 |
Afghanistan | 2015 | Births attended by skilled health personnel (%) | 50.5 |
Afghanistan | 2014 | Births attended by skilled health personnel (%) | 45.2 |
Afghanistan | 2012 | Births attended by skilled health personnel (%) | 39.9 |
Afghanistan | 2011 | Births attended by skilled health personnel (%) | 38.6 |
Afghanistan | 2010 | Births attended by skilled health personnel (%) | 34.3 |
Afghanistan | 2003 | Births attended by skilled health personnel (%) | 14.3 |
Albania | 2018 | Births attended by skilled health personnel (%) | 99.8 |
Albania | 2009 | Births attended by skilled health personnel (%) | 99.3 |
Albania | 2005 | Births attended by skilled health personnel (%) | 99.8 |
Algeria | 2013 | Births attended by skilled health personnel (%) | 96.6 |
Algeria | 2006 | Births attended by skilled health personnel (%) | 95.2 |
Andorra | 2017 | Births attended by skilled health personnel (%) | 100 |
Andorra | 2016 | Births attended by skilled health personnel (%) | 100 |
Andorra | 2015 | Births attended by skilled health personnel (%) | 100 |
Angola | 2016 | Births attended by skilled health personnel (%) | 46.6 |
Angola | 2007 | Births attended by skilled health personnel (%) | 47.3 |
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps

Knowledge Booster
Similar questions
- The grayscale2 function is already written, you just need to write inside it how to convert an image to grayscale using the crude average of RGB: from images import Image def grayscale1(image): """Converts an image to grayscale using the psychologically accurate transformations.""" for y inrange(image.getHeight()): for x inrange(image.getWidth()): (r, g, b) = image.getPixel(x, y) r = int(r * 0.299) g = int(g * 0.587) b = int(b * 0.114) lum = r + g + b image.setPixel(x, y, (lum, lum, lum)) def grayscale2(image): """Converts an image to grayscale using the crude average of the r, g, and b""" pass def main(): filename = input("Enter the image file name: ") image = Image(filename) grayscale2(image) image.draw() if __name__ == "__main__": main()arrow_forwardHaving a hard time figuring out this Python code. Would really appreciate some helparrow_forwardThere is a csv file called Air_Quality.csv. It has 12 columns and 17,000 rows. One column titled 'Name' which has a various emissions listed in it. Another column titled 'Geo Place Name' has a list of cities. Write a code (in the most basic Python) which finds the two emissions called PM2.5-Attributable Respiratory Hospitalizations (Adults 20 Yrs and Older) and PM2.5-Attributable Respiratory Hospitalizations (Adults 40 Yrs and Older)within the column and prints out which city has the respiratory hospitalizations for both 20 years and older and 40 years and older based on a column called 'Data Value' Below is a picture of a small chunk of the csv file.arrow_forward
- PYTHON I have a file name KindOfNumbers.csv In that csv file there are these numbers: 2, 3, 6, 8, 9, 13, 16, 15, 28, 97, 64, 67, 59, 100, 128, 496, 386 893 4567, 843, 894, 935, 974, 863, 991. In PYTHON, After reading the data from the csv file, CREATE THE FOLLOWING LISTS FROM GIVEN NUMBERS: _PRIME NUMBERS _PERFECT NUMBERS _ODD NUMBERS _EVEN NUMBERS ***EACH LIST SHOULD BE SORTED. ***WRITE THE ARRAYS, INCLUDING THE SORTED ORIGINAL, TO A FILE WITH APPROPRIATE DESCRIPTION INCLUDING THE NUMBERS OF VALUES IN THE ARRAY.arrow_forwardFor this project, you will be writing regular expressions that look for and find all instances of a date in any given string. Your program should: Find the following different formats for dates: August 2nd, 1994 august 2, 1994 08/02/1994 08/02/94 08-02-1994 Your program should be case insensitive using re.IGNORECASE Your program can only have a maximum of two different regexes. A special prize goes to those of you who can fit all of this into one regex Your program should be able to tell if the date is a valid date. For example, if the date says 99/99/99, then your program should ignore this as a date. HINT: this is not done within the regex. Try saving your dates to something like a list and going through that list after your regex runs. At the end of your program, it should print out all of the dates in the following format: mm/dd/yyyy. EX. 08/02/1994 Your program should use at least two character classes, you may need more. Feel free to make your own custom classes as well.…arrow_forwardThe second picture is the code. I want the output of the code to look like picture one. What part do I have to fix? THX!arrow_forward
- In pythonarrow_forwardWrite a program that reads movie data from a CSV (comma separated values) file and output the data in a formatted table. The program first reads the name of the CSV file from the user. The program then reads the CSV file and outputs the contents according to the following requirements: Each row contains the title, rating, and all showtimes of a unique movie. A space is placed before and after each vertical separator ('|') in each row. Column 1 displays the movie titles and is left justified with a minimum of 44 characters. If the movie title has more than 44 characters, output the first 44 characters only. Column 2 displays the movie ratings and is right justified with a minimum of 5 characters. Column 3 displays all the showtimes of the same movie, separated by a space. Each row of the CSV file contains the showtime, title, and rating of a movie. Assume data of the same movie are grouped in consecutive rows. Hints: Use the find() function to find the index of a comma in each row of…arrow_forwardWrite a program named PullPDF2 to pull text information from a PDF document. Your program should include two functions. Pull the data from the pdf file USCensus.pdf into a text file called USCensus_Output.txt. The file USCensus.pdf exists in the PythonFile directory of your VCASTLE Pod. Take a screenshot of your completed program and another of your output. Your output may be a screen shot of the last 20 lines of the USCensus_Output.txt file. Show the title bar of the code window, and include the VCASTLE system date and time in the lower right hand corner of the screen.arrow_forward
- Write a complete HTML file that provides the embedded JavaScript that prompts a user for the radius and height of a cylindrical container and calls a function computeVolume() to calculate, which passes the answer to another function printAnswer() to print the answer. Volume is calculated by the formula V=πr2h .Use 3.142 as value of π. The user should input the radius through an HTML form text field or a window prompt. Typical output would be “for a cylinder of height x and radius y its volume is z units of volume’.arrow_forwardWrite a program called rectangle.cpp. The program should have a rectangle struct to capture the length and width of a rectangle. The program should use a function to prompt the user for the dimensions and store the values in an instance of the struct. Once the dimensions are entered, the program should enter a loop that prints the area of the rectangle and then doubles the dimensions of the rectangle. It should continue this loop of printing the area and doubling the dimensions until the area is greater than or equal to 500 (i.e., terminate the loop when the last output area value is greater or equal to 500). The doubling part must be done in a function. Sample Output Enter the starting length: -30 Please enter a length greater than zero! Enter the starting length: 50 Enter the starting width: 0 Please enter a width greater than zero! Enter the starting width: 2 50 x 2 : 100 100 x 4 = 400 200 x 8 = 1600 DONEarrow_forwardin python. you will import the json module. Write a class named SatData that reads a JSON file containing data on 2010 SAT results for New York City and writes the data to a text file in CSV format. Your code does not need to access the internet. CSV is a very simple format - just commas separating columns and newlines separating rows (see note below about commas that are part of field names). You'll see an example of CSV format below. There is a csv module for Python, but you will not use it for this project. Your class should have: an init method that reads the file and stores it in whatever data member(s) you prefer. Any data members of the SatData class must be private. a method named save_as_csv that takes as a parameter a list of DBNs (district bureau numbers) and saves a CSV file that looks like this, but with only the rows that correspond to the DBNs in the list (and also the row of column headers). To see what CSV syntax looks like, open the file as a text file rather than as…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY