Python reading csv file by read_csv
Question:
Hello data science community, how can i read a csv file without using separators?
pd.read_csv(filename)
but without using separator
I tried but it gives me error unicode
Answers:
i think this will work:
import csv
with open('/Users/bandarhelal/Downloads/electronic-card-transactions-september-2019-csv-tables.csv', mode='r') as testfile:
arr = testfile.readlines()
for line in arr:
print(line.replace(',', ' '))
import panadas as pd
data_frame = pd.read_csv(full file path)
Hello data science community, how can i read a csv file without using separators?
pd.read_csv(filename)
but without using separator
I tried but it gives me error unicode
i think this will work:
import csv
with open('/Users/bandarhelal/Downloads/electronic-card-transactions-september-2019-csv-tables.csv', mode='r') as testfile:
arr = testfile.readlines()
for line in arr:
print(line.replace(',', ' '))
import panadas as pd
data_frame = pd.read_csv(full file path)