python pandas 读取msql并转置数据表

import random,string,json,pymysql

import pandas as pd
connect = pymysql.connect(user = '',
            password = 'h',
            db = 'g,
            host = 'r',
            port = 3306,
            charset = 'utf8'
            )
con = connect.cursor()
sql="select * from sheet1"
aa=pd.read_sql(sql,con=connect)
aa.transpose()

 

posted @ 2023-09-13 16:11  myrj  阅读(23)  评论(0编辑  收藏  举报