SQL异常字符去除
import pandas as pd
from grant.sql_connection import tellus_conn
sql = r'''select a.uid,REGEXP_REPLACE(a.beizhu, '[\\x00-\\x1F\\x7F]', '') AS beizhu_cleaned from joinleader_app_run.hj_kehutoushuhead_gdc2aqdm a;'''
df = pd.read_sql(sql, tellus_conn)
df.to_excel('df.xlsx', index=False)
浙公网安备 33010602011771号