Skip to main content

Posts

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

ads1

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

18.Read the ‘Student.csv’ to create a data frame and do the following  operation: To display Adm_No, Gender and Percentage from ‘Student.csv’ file. To display the first 5 and last 5 records from ‘Student.csv’ file. Solution :-  import pandas as pd import csv # To Display the Data df=pd.read_csv("Student.csv",usecols=['Adm_No','Gender ','Perc']) print("To display Adm_No, Gender and Percentage from ‘student_result.csv’ file.") print(df) # To display first 5 and last 5 records from ‘student_result.csv’ file. df1 = pd.read_csv("Student.csv") print(df1.head()) print(df1.tail()) Output :-  Link to Download Excel File

ads2