当前位置:网站首页>Pandas reads MySQL data
Pandas reads MySQL data
2022-07-01 12:07:00 【Paper scum】
def get_data():
conn = pymysql.connect(host=RSYS_HOST,
port=RSYS_PORT,
user=RSYS_USER,
passwd=RSYS_PASSWORDD,
db=RSYS_DB_NAME,
charset='utf8')
results = None
try:
read_result = pd.read_sql(sql, conn)
result_json = json.loads(read_result.reset_index().to_json(orient='records', force_ascii=False))
logger.info(sql)
return result_json
except Exception as e:
# Rollback on error
logger.error("Error: unable to fecth data: %s,%s" % (repr(e), sql))
conn.rollback()
finally:
conn.close()
return results边栏推荐
- Comment Cao définit la décimale de dimension
- Machine learning - Data Science Library - day two
- 【单片机】【数码管】数码管显示
- 用实际例子详细探究OpenCV的轮廓检测函数findContours(),彻底搞清每个参数、每种模式的真正作用与含义
- I'm in Zhongshan. Where is a better place to open an account? Is it actually safe to open an account online?
- C # dependency injection (straight to the point) will be explained as soon as you see the series
- Leetcode force buckle (Sword finger offer 31-35) 31 Stack push pop-up sequence 32i II. 3. Print binary tree from top to bottom 33 Post order traversal sequence 34 of binary search tree The path with a
- Interpretation of R & D effectiveness measurement framework
- Technology sharing | MySQL: how about copying half a transaction from the database?
- 241. Design priority for operational expressions: DFS application questions
猜你喜欢

使用set_handler过滤掉特定的SystemC Wraning &Error Message

Learning summary on June 30, 2022

Typora realizes automatic uploading of picture pasting

CPI tutorial - asynchronous interface creation and use

Message queue monitoring refund task batch process

Comment Cao définit la décimale de dimension
![[classic example] classic list questions @ list](/img/d8/a259e5f9d08eacbef31254d1bc3304.jpg)
[classic example] classic list questions @ list

Theoretical basis of graph

Learning summary on June 28, 2022

Joint Time-Frequency and Time Domain Learning for Speech Enhancement
随机推荐
leetcode 406. Queue reconstruction by height
CPU 上下文切换的机制和类型 (CPU Context Switch)
Harbor webhook from principle to construction
自组织是管理者和成员的双向奔赴
谈思生物直播—GENOVIS张洪妍抗体特异性酶切技术助力抗体药物结构表征
Talk about the pessimistic strategy that triggers full GC?
Personnaliser le plug - in GRPC
消息队列之监控退款任务批处理过程
[classic example] classic list questions @ list
[MCU] [nixie tube] nixie tube display
我在中山,到哪里开户比较好?实际上网上开户安全么?
MQ-防止消息丢失及重复消费
使用set_handler过滤掉特定的SystemC Wraning &Error Message
About keil compiler, "file has been changed outside the editor, reload?" Solutions for
力扣首页简介动画
91. (cesium chapter) cesium rocket launch simulation
Unity xlua co process packaging
Epoll introduction
Adjacency matrix undirected graph (I) - basic concepts and C language
Software project management 9.2 Software project configuration management process