Question: Problem 1 - Student Loans (Please using python to solve this problem) If you attend a school with a higher tuition, do you end up

Problem 1 - Student Loans (Please using python to solve this problem)

If you attend a school with a higher tuition, do you end up with more debt?

Laney recently hosted a friends daughter who came to visit Northeastern;

She applied here as well as Tufts and Brown. Northeastern is the cheapest on paper,

But her higher priority is graduation with the least debt.

Lets find the best fit!

The input file has 12 lines of data, 4 for each school that look like this:

1. School name

2. Average debt per student (federal loans)

3. Yearly tuition

4. School color

Read in the data, saving each piece of information in its own variable.

Compute the average debt across all three schools.

Use matplotlib to plot the tuition values (x axis) against the debt values (y axis) in a scatterplot.

The color of each data point comes from the file. For full credit under communication.

Your plot must have:

1. A title

2. Labels on the x and y axes

3. Reasonable x-limit and y-limit

4. The data points themselves

5. A horizontal line representing the average debt you computed above

6. A legend, so that we see the name of each school

Please follow the rubrics below:

Gather data

Open the file and read in school name (string), average debt (int), tuition (int), and color (string) for each school

Save every line of the file as a variable

Computations

Compute average debt over the 3 relevant data points

Communicate

Use matplotlib to create a plot as described

Scatterplot with debt on y axis, tuition on x axis

Plot also has a horizontal line for average debt

Plot has labels, title, legend, and correct colors (from the file)

Readability

File name is saved in a constant above main

Problem 1 - Student Loans (Please using python to solve this problem)

Filename: loans.py Also submit: A screenshot (or download) of your plot Input files: Download debt vs tuition.txt, and save it in the same directory as your loans.py file If you attend a school with a higher tuition, do you end up with more debt? Laney recently hosted a friend's daughter who came to visit Northeastern; she applied here as well as Tufts and Brown. Northeastern is the cheapest on paper, but her higher priority is graduation with the least debt. Let's find the best fit! The input file has 12 lines of data, 4 for each school that look like this: - School name - Average debt per student (federal loans) - Yearly tuition - School color Read in the data, saving each piece of information in its own variable. Compute the average debt across all three schools. Use matplotlib to plot the tuition values ( x axis) against the debt values ( y axis) in a scatterplot. The color of each data point comes from the file. For full credit under communication, your plot must have: - A title - Labels on the x and y axes - Reasonable x-limit and y-limit - The data points themselves - A horizontal line representing the average debt you computed above - A legend, so that we see the name of each school

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!