学会思考
刻意练习
摘要: 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... 阅读全文
posted @ 2018-09-13 23:20 Worty 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 1 # 写方法1 2 f = open('tmp.txt','w') 3 f.write('hello world') 4 f.close() 5 6 # 写方法2 7 with open('tmp.txt','w') as f: 8 f.write('hello \n word') 9 10 # 读 11 with open('tmp.txt', 'r'... 阅读全文
posted @ 2018-09-13 22:42 Worty 阅读(118) 评论(0) 推荐(0) 编辑