7. Write the statement in Pandas to find the highest percentage and also print the student’s name and percentage.
Solution :-
import pandas as pd import numpy as np import csv # To create a duplicate file for ‘student_result.csv’ containing Adm_No, Name and Percentage. df = pd.read_csv(“Student.csv”) df.to_csv(‘CopyStudent.csv’,columns=[‘Adm_No’,”Name “,”Perc”]) #Display copied DataFrame df2 = pd.read_csv(“CopyStudent.csv”) print(df2) # find the highest percentage and also print the student’s name and percentage. df1 = pd.read_csv(“Student.csv”) df1 = df1[[“Name “,”Perc”]] [df1.Perc == df1[‘Perc’].max()] print(df1)