Read csv files

1) Using csv.read

python built in function

import csv

f = open('mydata.csv', 'r')

for row in csv.reader(f, delimiter=',', skipinitialspace=True):

print(row)

f.close()

# csv gives data as list in list [[ ]]

2) Using panda

not build in function, might need installation

import pandas as pd

mydataframe = pd.read_csv('mydata.csv')