python#读csv,excel,json数据

2021-06-30 02:06

阅读:678

标签:div   nbsp   load   xls   excel   int   python   word   col   

 1 #读csv,excel,json数据
 2 with open(E:\\test\\xdd.csv,r) as f:
 3     for line in f.readlines():
 4         print(line)    
 5 
 6 
 7 import pandas
 8 df = pandas.read_csv(E:\\test\\xdd.csv)
 9 print(df)
10   
11 import pandas
12 df = pandas.read_excel(E:\\test\\aa.xls)
13 print(df)
14 
15 import json
16 with open(E:\\test\\bb.json,r) as f:
17     jd = f.read()
18 dic = json.loads(jd)
19 print(dic)
20 for word in dic:
21     print(word.get("xx"),word.get("yy"))

 

python#读csv,excel,json数据

标签:div   nbsp   load   xls   excel   int   python   word   col   

原文地址:https://www.cnblogs.com/hujianglang/p/9643925.html


评论


亲,登录后才可以留言!