Data Interview Qs - Assigning grades

InterviewQs

Assigning grades

Data Analysis Python Pandas Data Manipulation Looping through Dataframe

Forward this email to a friend or colleague and challenge them to solve it.

Hi, 

You are given a dataframe (called df) of students, and you need to assign grades to each student. The table schema is as follows:

Column name Data type Example value Description
student_name string Cindy Chu Name of student
student_id integer 1837204 Unique id for each student
class string Biology Name of class
final_grade_pct integer 80 final grade for class represented in percent

You need to assign the following letter grades based on final_grade_pct in a new column named "final_grade_letter":
  • >90 - A
  • 81-90 - B
  • 71-80 - C
  • <70 - D

Write a function using Python to loop through the table and assign the appropriate letter grades to each student, adding a new column to the existing dataframe, df.



 

You’ve accumulated 188 questions since joining our email list. Create a premium account to access detailed solutions to each problem (including this one) + our new Case studies.


Was this email forwarded to you? You can join our list here to receive questions

How did you like today's question?

15411 Boischatel, Montreal, QC, H9H1Y7, Canada
Don't want to get these emails anymore? We'll forgive you if you unsubscribe

Key phrases

Older messages

Amoeba Population

Monday, September 13, 2021

Statistics, Probability Theory, Law of Total Probability, InterviewQs Amoeba Population Statistics Probability Theory Law of Total Probability Forward this email to a friend or colleague and challenge

Smallest subarray with a sum greater than X

Friday, September 10, 2021

Python, Data Structures, Arrays, InterviewQs Smallest subarray with a sum greater than X Python Data Structures Arrays Forward this email to a friend or colleague and challenge them to solve it. Hi,

Airbnb stays by country

Wednesday, September 8, 2021

SQL, Database Querying, InterviewQs Airbnb stays by country SQL Database Querying Forward this email to a friend or colleague and challenge them to solve it. Hi, Suppose you work for Airbnb as an

Fraudulent transactions

Monday, September 6, 2021

Data Analysis, Python, Pandas, Data Manipulation, Data Visualization, Histogram, External Dataset, InterviewQs Fraudulent transactions Data Analysis Python Pandas Data Manipulation Data Visualization

Bias-Variance Tradeoff

Friday, September 3, 2021

InterviewQs Bias-Variance Tradeoff Forward this email to a friend or colleague and challenge them to solve it. Hi, Can you explain what the Bias-Variance Tradeoff is? Can you share an example of when

You Might Also Like

Power BI Weekly #256 - 1st May 2024

Wednesday, May 1, 2024

Power BI Weekly Newsletter Issue #256 powered by endjin Welcome to the 256th edition of Power BI Weekly! No announcements this week, so we'll jump straight into the highlighted articles. Firstly,

Apple AI browser 🌎, Tesla fires Supercharger team ⚡,  new sudo replacement 👨‍💻

Wednesday, May 1, 2024

Apple is testing a version of its Safari web browser that includes an AI-powered tool called Intelligent Search Sign Up |Advertise|View Online TLDR Together With Modern Treasury TLDR 2024-05-01 The

JSter #218 - Libraries and more

Wednesday, May 1, 2024

All JavaScript is good JavaScript. I'm close to done with my SurviveJS rework. The new site will have more content while being much lighter and faster to compile so that's all good. Libraries

BetterDev #258 - Build an 8-bit computer from scratch and Home automation with ESP8266

Wednesday, May 1, 2024

Better Dev #258 Apr 30, 2024 Hi all, We come back with a new issue this week. If you like BetterDev, please help spead word out by refer to your friends. Buy me a coffee would be great too. Build an 8-

Interface Interference 👎

Wednesday, May 1, 2024

Amid the AI device dunking, should everything “just be an app”? Here's a version for your browser. Hunting for the end of the long tail • April 30, 2024 Interface Interference The problem

Some Tesla Supercharger jobs get a jolt

Tuesday, April 30, 2024

Plus: Amazon CodeWhisperer changes its name and Arc gets a Windows version View this email online in your browser By Christine Hall Tuesday, April 30, 2024 Welcome to TechCrunch PM, bringing you the

Relief From Tinnitus: Free Discovery Call!

Tuesday, April 30, 2024

Do you suffer from tinnitus or a ringing in your ears? 1 in 3 adults over the age of 65 will suffer from this condition and often don't know there are things you can do to help. Our friends at

WebAIM April 2024 Newsletter

Tuesday, April 30, 2024

WebAIM April 2024 Newsletter Read this newsletter online at https://webaim.org/newsletter/2024/april Feature Web Accessibility in the 2024 Presidential Campaigns WebAIM's John Northup ran the US

👀 Being More Productive on a Smaller Screen — How to Hide Games on Steam Family Sharing

Tuesday, April 30, 2024

Also: What to Expect From Apple's "Let Loose" Event, and More! How-To Geek Logo April 30, 2024 Did You Know The letter J is the only letter that makes no appearance on the Periodic Table.

PEP 686, Lazy Evaluation, Serverless Python, and More

Tuesday, April 30, 2024

PEP 686: Make UTF-8 Mode Default #627 – APRIL 30, 2024 VIEW IN BROWSER The PyCoder's Weekly Logo PEP 686: Make UTF-8 Mode Default This Python Enhancement Proposal outlines making UTF-8 the default