xxxxxxxxxx
import pandas as pd
df = pd.read_csv (r'Path where the CSV file is stored\File name.csv')
print (df)
xxxxxxxxxx
import csv
# open the file
with open('csvfile.csv' , 'r') as csvfile:
# create the object of csv.reader()
csv_file_reader = csv.reader(csvfile,delimiter=',')
for row in csv_file_reader:
print(row)
xxxxxxxxxx
import csv
with open('filename.csv') as csvfile:
spamreader = csv.reader(csvfile)
for row in spamreader:
print(row)
xxxxxxxxxx
import pandas as pd # pip install pandas
#read the CSV file
data_file = =pd.read_csv('some_file.csv')
print(data_file)
xxxxxxxxxx
# Way 1 : Import as dataframe
import pandas as pd
data = pd.read_csv("filename.csv")
# Way 2 : Import as list of tuples
import numpy as np
data = np.recfromcsv(file)
xxxxxxxxxx
import pandas as pd # pip install pandas
#read the CSV file
data_file = =pd.read_csv('some_file.csv')
print(data_file)
xxxxxxxxxx
lines = [] # a list of lists, the first list being a header, and the rest being the data
with open("your_filename", newline='') as f:
file = csv.reader(f)
for each in file:
lines.append(each)
print(lines)
xxxxxxxxxx
# import des librairies dont nous aurons besoin
import pandas as pd
import numpy as np
import re
# chargement et affichage des données
data = pd.read_csv('personnes.csv')
print(data)
xxxxxxxxxx
import csv
with open('passwd', newline='') as f:
reader = csv.reader(f, delimiter=':', quoting=csv.QUOTE_NONE)
for row in reader:
print(row)
xxxxxxxxxx
import pandas as pd
import io
df = pd.read_csv(io.BytesIO(uploaded['file.csv']))
print(df)