5. Create a series object marks, containing marks of 6 students. Write a Python program to sort the values of a Series object marks in ascending order and descending order and store it into Series object ascMarks and descMarks respectively.
Solution :-
import pandas as pd mrk = [98,49,86,78,96,59] names = [‘Aman’,’Manan’,’Rashi’,’Muskan’,’Manvi’,’Karan’] marks = pd.Series(mrk,names) print(“marks :- “) print(marks) ascMarks = marks.sort_values(ascending=True) print(“Marks after sorting in Ascending order :- “) print(ascMarks) desMarks = marks.sort_values(ascending=False) print(“Marks after sorting in Dscending order :- “) print(desMarks)