Advertisements
Advertisements
Question
Consider the data of unit test marks given at program, write the python statements to print name wise UT marks in mathematics.
| Result | ||||||
| Name/Subjects | Unit Test | Maths | Science | S.St. | Hindi | Eng |
| Raman | 1 | 22 | 21 | 18 | 20 | 21 |
| Raman | 2 | 21 | 20 | 17 | 22 | 24 |
| Raman | 3 | 14 | 19 | 15 | 24 | 23 |
| Zuhaire | 1 | 20 | 17 | 22 | 24 | 19 |
| Zuhaire | 2 | 23 | 15 | 21 | 25 | 15 |
| Zuhaire | 3 | 22 | 18 | 19 | 23 | 13 |
| Aashravy | 1 | 23 | 19 | 20 | 15 | 22 |
| Aashravy | 2 | 24 | 22 | 24 | 17 | 21 |
| Aashravy | 3 | 12 | 25 | 19 | 21 | 23 |
| Mishti | 1 | 15 | 22 | 25 | 22 | 22 |
| Mishti | 2 | 18 | 21 | 25 | 24 | 23 |
| Mishti | 3 | 17 | 18 | 20 | 25 | 20 |
Code Writing
Advertisements
Solution
print(df.set_index(['Name', 'Unit Test'])['Maths'])
shaalaa.com
Is there an error in this question or solution?
