Skip to main content

Posts

Showing posts with the label 7.Read the ‘Student_result.csv’ to create a data frame and do the following operation:

ads1

20.Read the ‘Student_result.csv’ to create a data frame and do the following operation:

7.Read the ‘Student_result.csv’ to create a data frame and do the following  operation: To create a duplicate file for ‘student_result.csv’ containing Adm_No, Name and Percentage. 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) Output :-   Link to Download Excel File   

ads2