时间:2020-12-19 10:18:08 | 栏目:Python代码 | 点击:次
pandas 读取各种格式文件:
前置工序: import pandas as pd
csv 文件读取中文错误处理: utf-8 codec can't decode ....
pd.read_csv('c:/mydata/jit.csv',encoding='gb18030')
sql 读取:
import pymysql conn=pymysql.connect(host='127.0.0.1', user='root', passwd='root', db=' employee') sql='select * from employee' pd.read_sql(sql, conn)