Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Python. Transform the letter grades to simplified 4.0 scale. In the simplified scale, there are only 5 available grades, which are `A`, `B`, `C`,

Using Python. Transform the letter grades to simplified 4.0 scale. In the simplified scale, there are only 5 available grades, which are `A`, `B`, `C`, `D`, and `F`. Thus, remove the `+` and `-` suffixes from the letter grades before mapping. If the input grade is not valid (e.g., `S`, return np.nan).

When transforming letter grades to 4.0 scale, use the following mapping:

- A => 4.0

- B => 3.0

- C => 2.0

- D => 1.0

- F => 0.0

Resulting data frame should include both letter grades and simplified 4.0 scale grades.

_____________________________________________________________________

The solution starts with:

import pandas as pd

grades_df = pd.DataFrame(data = {'John': ['A+'], 'Linus':['B'], 'Alan':['C-'], 'Ada':['D'], 'Grace':['B+'], 'Donald':['F']}, index=['Letter_Grades']).T

...

# The input

# grades_df['4.0scale'] should return

# John 4.0

# Linus 3.0

# Alan 2.0

# Ada 1.0

# Grace 3.0

# Donald 0.0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

Solve the integral:

Answered: 1 week ago

Question

What is meant by Non-programmed decision?

Answered: 1 week ago

Question

What are the different techniques used in decision making?

Answered: 1 week ago