To write a python program for reading content from a CSV file.
- Hardware โ PCs
- Anaconda โ Python 3.7 Installation / Moodle-Code Runner
Import pandas as pd.
Read the CSV file using read_csv method.
Use len() method to get the number of rows and columns
Use len() method to get the number of rows and colu
Print the output.
#To write a python program for reading content from a CSV file.
#Developed by: Mohammed Faizal.J
#Register Number: 22003412
import pandas as pd
df=pd.read_csv('Downloads/nba.csv')
print(df.head(10))
print(df.tail())
print("rows",len(df.axes[0]))
print("columns",len(df.axes[1]))
Thus the program is written to copy contents from one file to another.