I have data of a Subject Marks in a column of marks.csv file as given below.
Students Marks
0 Santosh 90
1 Mahesh 35
2 Suresh 15
3 Ganesh 45
4 Ramesh 60
5 Supriya 25
6 Ritesh 50
7 Pooja 95
I want to classify this marks as per grades:
Marks > 80 (Distinguished);
Marks > = 50 & Marks < 80 (First Class);
Marks > = 35 & Marks < 50 (Second Class);
Marks < 35 (Failed).
In result, I need output in same file .csv as like given below.
Student Marks Grades
0 Santosh 90 Distinction
1 Mahesh 35 Secnd Class
2 Suresh 15 Failed
3 Ganesh 45 Secnd Class
4 Ramesh 60 First Class
5 Supriya 25 Failed
6 Ritesh 50 First Class
7 Pooja 95 Distinction
Any suggestions is helpful.
Aucun commentaire:
Enregistrer un commentaire