To write a python program to read contents from a CSV file.
Import pandas module as pd.
Using pd.read_csv() method read the CSV file.
Using df.head() print the first 10 rows of the CSV file.
Using df.tail() print the last 5 of the CSV file.
Using len(df.axes[]) print the toal no.of rows and columns with argument 0 for row and argument 1 for column.
#Program to read contents from a CSV file.
#Developed by: PAVANA G
#RegisterNumber: 212222230105
import pandas as pd
df = pd.read_csv("data.csv")
print(df.head(10))
print(df.tail())
print("No.of Rows:",len(df.axes[0]))
print("No.of Columns:",len(df.axes[1]))
Hence the python programe to read the contents from a csv file is executed successfully!