I think this should do it:
records = records.replace("\"","")
Using pandas.read_csv
is better for working with csv files
import pandas as pd
csv = pd.read_csv('data.csv', delimiter=',', names=['x', 'y', 'z'])
# iterate over the dataframe
for index, row in csv.iterrows():
print(row['x'], row['y'], row['z'])
假设data.csv
的内容是这样的
Mp4,Mp3,"1234554"
The Output would look like this:
Mp4 Mp3 1234554
如果你的csv文件包括列名,如
file_type1,file_type2,size
mp4,mp3,"1234554"
如果你读入csv文件,只需删除names
参数。
csv = pd.read_csv('data.csv', delimiter=',')
print(csv)
Then the Output would look like this:
file_type1 file_type2 size
0 mp4 mp3 1234554