[英]Cross check between two data frames?
I have a df of students with numeric grades in different classes.我有一群在不同班级有数字成绩的学生。 Then, I have another df that that has a points scale for each class (thresholds)
然后,我有另一个 df,每个 class(阈值)都有一个分数刻度
Students Math English
Josh 45 27
Max 23 37
Justin 34 13
Charles 56 27
Points scale点刻度
points Math English
1 10 5
2 20 10
3 30 15
4 40 20
5 50 25
I want to assign points to different students from their grades for each class based off of the points scale我想根据分数等级为每个 class 的学生从他们的成绩中分配分数
How can I make a dataframe that looks like this:如何制作如下所示的 dataframe:
Students Math English
Josh 4 5
Max 2 5
Justin 3 2
Charles 5 3
If someone has an English score of 16 for example, they would get 3 points, not 4.例如,如果某人的英语成绩为 16 分,他们将获得 3 分,而不是 4 分。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.