Read a csv file as a pandas DataFrame

pandas.read_csv reads a csv file and returns a DataFrame.

import pandas

c = pandas.read_csv('a.csv')

print(type(c))  # <class 'pandas.core.frame.DataFrame'>
print(c)
#    name  age
# 0  Josh   27
# 1  Kyle   53
# 2   Bob   48

a.csv

name,age
Josh,27
Kyle,53
Bob,48

A Python file and a.csv are in the same folder.

pandas file

pandas tutorial