Using pandas for data sorting and ranking.
complete lines of code please
Exercise 1 Using pandas for data sorting and ranking. You can use colab or any other platform, please include the code and screenshot of the results in the logbook. Starting from the following code, please insert your lines of code: from pandas import Series, DataFrame import pandas as pd import numpy as np ## Create a dictionary with student details student_details = {'Name':['Raj', 'Raj', 'Raj', 'Aravind', 'Aravind', 'Aravind', 'John', 'John', 'John', 'Arjun', 'Arjun', 'Arjun'], 'Subject: ['Maths', 'Physics', 'Chemistry', 'Maths', 'Physics', 'Chemistry', 'Maths', 'Physics', 'Chemistry', 'Maths', 'Physics', 'Chemistry'], 'Marks':[80, 90, 75, 60, 40, 60, 80, 55, 100, 90, 75, 70] } ## Convert dictionary to a DataFrame # Insert you code here ## Create a new column with Marks ## ranked in descending order # df['Mark_Rank'] = df['Marks'].rank(ascending = 0) ## Set index to newly created column and print the df # Insert your code ## Sort the DataFrame based on the index and print the df # Insert your code ## Rank the marks using the following methods: default, max, bottom. Print the df # Insert your code Exercise 2 Create a column in pandas dataframe using for loop. Run the following code and check the resulting outcome. raw_Data = {"Voter_name': ['Geek1', 'Geek2', 'Geek3', 'Geek4', 'Geek5', 'Geek6', 'Geek7', 'Geek8"], 'Voter_age': [15, 23, 25, 9, 67, 54, 42, np.NaN]} df = pd.DataFrame(raw_Data, columns = ['Voter_name', 'Voter_age']) df 1