how to read csv file column wise in python code example
Example 1: Column names reading csv file python
df = pd.read_csv('file.csv', names=['a', 'b', 'c'], header=None)
df.rename(columns = {'a':'A', 'b':'B', 'c':'C'}, inplace = True)
df.to_csv('file.csv')
Example 2: read cells in csv with python
import csv
with open(myfilepath, 'rb') as f:
mycsv = csv.reader(f)
for row in mycsv:
text = row[1]
............