Skip to content

How to read a csv file in Python?

# pip install pandas 
import pandas as pd

# Read the csv file
data = pd.read_csv('data.csv')

# Print it out if you want
print(data)
See also  Python code snippet - How to loop through files in a directory ?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.