标签:hub lock 表头 name mysqld 根据 mysq flow 设置
sms = pd.read_csv(‘./data/SMSSpamCollection‘, sep=‘\t‘,header=None)
sep: 分隔符 header: 不要表头
pd.read_csv(‘./type-.txt‘, sep=‘-‘, header=None)
pd.read_table(‘./data/SMSSpamCollection‘, header=None)
pd.read_excel(‘./read_xlsx.xlsx‘, sheet_name=2)
conn = sqlite3.connect(‘./data.sqlite‘)
weather_2017 = pd.read_sql(‘select * from weather_2017 limit 30‘, conn, index_col=‘index‘)
- 设置行索引index_col
weather_2017.to_csv(‘./weather_2017.csv‘)
weather_2017.to_json(‘./weather_2017.json‘)
weather_2017.to_html(‘./weather_2017.html‘)
weather_2017.to_sql(‘weather_2019‘, conn, if_exists=‘append‘)
import pymysql
conn = pymysql.connect(host=‘127.0.0.1‘, port=3306, user=‘root‘, password=‘root‘, database=‘maoyan‘, charset=‘utf8‘)
goods_data = pd.read_sql(‘select * from goods limit 20‘,conn)
from sqlalchemy import create_engine
engine = create_engine(‘mysql+mysqldb://root:450502@localhost:3306/?charset=utf8‘)
goods.to_sql(‘goods‘, engine)
pd.read_csv(‘https://raw.githubusercontent.com/datasets/investor-flow-of-funds-us/master/data/weekly.csv
标签:hub lock 表头 name mysqld 根据 mysq flow 设置
原文地址:https://www.cnblogs.com/Deaseyy/p/11921642.html