14.WRITE A PROGRAM TO READ FROM A CSV FILE EMPLOYEE.CSV AND CREATE A DATAFRAME FROM IT, AND (I) PRINT THE DATAFRAME , (II)
PRINT THE FIRST 2 ROWS , (III) PRINT THE LAST 2 RECORDS.

EMPLOYEE CSV FILES CONTAINS (EMPNO, NAME, DESGINATION, SALARY) OF 6 EMPLOYEES.

Solution :- 

CSV File :- 

 

 

Solution :- 

import pandas as pd
df = pd.read_csv(“emp.csv”)
print(df)
print(df.head(2))
print(df.tail(2))

Output :-