Q. Three Series objects store the marks of 10 students in three terms. Roll numbers of students from the index of these Series objects. The Three Series objects have the same indexes.


Calculate the total weighted marks obtained by students as per following formula:

Final marks = 25%. Term 1 + 25% Term 2 + 50% Term 3

Store the Final marks of students in another Series object.


You can understand by Watching video :-




Answer =


import pandas as pd

Term1 = pd.Series([40,35,25,20,22,26,28,29,23,28])
Term2 = pd.Series([28,15,37,38,45,41,48,47,30,20])
Term3 = pd.Series([36,23,34,31,21,22,23,24,26,28])
final_mark = (Term1*25)/100 + (Term2*25)/100 + (Term3*50)/100

print(final_mark)

Output :-

0    35.00
1    24.00
2    32.50
3    30.00
4    27.25
5    27.75
6    30.50
7    31.00
8    26.25
9    26.00
dtype: float64

>>>

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post