how to get data from csv file python code example
Example 1: read entire csv file python
import csv
f = open("fileName.csv") # encoding="utf8"
reader = csv.DictReader(f) # delimiter=";", quotechar='"'
data = [row for row in reader]
Example 2: read csv python
import pandas as pd
data = pd.read_csv("filename.csv")
data.head()
Example 3: how to open csv file in python
import csv
with open('example.csv') as csvfile:
readCSV = csv.reader(csvfile, delimiter=',')