import pandas as pd
pdf=pd.read_csv("a.csv",index_col=False)
print(pdf)
# 转化为json格式
# 对索引序列化
s='title,description,by,url,tags,likes'
s=s.split(",")
src=[]
src.append(i for i in s)
# 使用pandas将csv改为json文件
df = pd.DataFrame(pdf,columns = src)
print(df)
pdf.to_json("a.json",force_ascii=False,orient = 'table',index=False)
03-26
1382
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)