Filename: loansv2.py Also submit: A screenshot (or download) of your plot Input files: Download debt_vs_tuition2.txt, and save it in the same directory as your loansv2.py file You'll need to open and read the file twice for this problem. Lists are not permitted in this homework, and you'll process the file using while loops. This problem has basically the same data about student loans that HW2 had, except more of it, and now we're more interested in the debt-to-tuition ratio. The file has: ● School name Average debt per student (federal loans) Yearly tuition ● ● Open the file and read in all the data so that you can compute the average debt for each school as a fraction of total tuition. You can assume that a given student's total tuition is the yearly tuition x4. (For example, northeastern's debt is $24,500 and tuition is $57,592, so our fraction would be 24500/(57592 x 4) = .106.) Determine the average debt to tuition fraction over all schools in the file, so that you can later plot each individual school's fraction against this average. Now that you have the average, you'll need to open the file a second time, and read in all the data again, this time plotting it against the average. Compute the same debt-to-tuition fraction for each school, and plot in one color if it's above the average, and a different color if it's at or below average. Create a scatterplot with tuition on the x axis, and debt fraction on the y axis. For full credit under communication, your plot must have: A title ● Labels on the x and y axes Reasonable x-limit and y-limit A horizontal line showing the average debt fraction, correctly labeled
Filename: loansv2.py Also submit: A screenshot (or download) of your plot Input files: Download debt_vs_tuition2.txt, and save it in the same directory as your loansv2.py file You'll need to open and read the file twice for this problem. Lists are not permitted in this homework, and you'll process the file using while loops. This problem has basically the same data about student loans that HW2 had, except more of it, and now we're more interested in the debt-to-tuition ratio. The file has: ● School name Average debt per student (federal loans) Yearly tuition ● ● Open the file and read in all the data so that you can compute the average debt for each school as a fraction of total tuition. You can assume that a given student's total tuition is the yearly tuition x4. (For example, northeastern's debt is $24,500 and tuition is $57,592, so our fraction would be 24500/(57592 x 4) = .106.) Determine the average debt to tuition fraction over all schools in the file, so that you can later plot each individual school's fraction against this average. Now that you have the average, you'll need to open the file a second time, and read in all the data again, this time plotting it against the average. Compute the same debt-to-tuition fraction for each school, and plot in one color if it's above the average, and a different color if it's at or below average. Create a scatterplot with tuition on the x axis, and debt fraction on the y axis. For full credit under communication, your plot must have: A title ● Labels on the x and y axes Reasonable x-limit and y-limit A horizontal line showing the average debt fraction, correctly labeled
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Solve this in Python code
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education