每日求一录~20170706
7 Frameworks To Build A REST API In Go
bejson json 在线编辑
qqe2 json 在线编辑
k8s-ceph-statefulsets-storageclass-nfs 动态卷有状态应用实践
抽个时间看一下,
有了项目用一下,
定制需求改一下,
实在不行写一下。
python模块导入原理
python模块及包的导入
python中的实例方法、静态方法、类方法、类变量和实例变量
python中self,cls
深刻理解Python中的元类(metaclass)
import pandas as pd
import pymysql
conn = pymysql.connect(host='127.0.0.1', port=3306, user='root', passwd='123456', db='db1')
cursor = conn.cursor()
# cursor.execute("DROP TABLE IF EXISTS test")#必须用cursor才行
sql = "select * from user"
df = pd.read_sql(sql,conn,)
aa=pd.DataFrame(df)
print aa
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import pandas as pd
import pymysql
conn = pymysql.connect(host='127.0.0.1', port=3306, user='root', passwd='123456', db='db1')
cursor = conn.cursor()
# cursor.execute("DROP TABLE IF EXISTS user_copy")#必须用cursor才行
sql = "select * from user"
df = pd.read_sql(sql,conn,chunksize=2)
for piece in df:
aa=pd.DataFrame(piece)
# pd.io.sql.write_frame(df, "user_copy", conn)#不能用已经移除
pd.io.sql.to_sql(piece, "user_copy", conn,flavor='mysql',if_exists='replace')#必须制定flavor='mysql'
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import pandas as pd
import pymysql
conn = pymysql.connect(host='127.0.0.1', port=3306, user='root', passwd='123456', db='db1',charset="utf8")
cursor = conn.cursor()
# cursor.execute("DROP TABLE IF EXISTS user_copy")#必须用cursor才行
sql = "select * from user"
df = pd.read_sql(sql,conn,chunksize=2)
for piece in df:
# pd.io.sql.write_frame(df, "user_copy", conn)#不能用已经移除
piece['xb'] = list(map(lambda x: '男' if x == '123' else '女', piece['pwd']))
print(piece)
pd.io.sql.to_sql(piece, "user_copy", conn,flavor='mysql',if_exists='append')#必须制定flavor='mysql'
# 用sqlalchemy链接
from sqlalchemy import create_engine
engine = create_engine("mysql+pymysql://root:123456@127.0.0.1:3306/db1?charset=utf8")
sql = "select * from user"
df = pd.read_sql(sql,engine,chunksize=2)
for piece in df:
print(piece)
pd.io.sql.to_sql(piece, "user_copy", engine, flavor='mysql', if_exists='append')
Python SQLAlchemy基本操作和常用技巧(包含大量实例,非常好)
北京博测科技Selenium公开课01
selenium 入门
Statistical data visualization using matplotlib http://seaborn.pydata.org
作者:百里求一
出处:http://www.cnblogs.com/bergus/
我的语雀: https://www.yuque.com/barry.bai
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。