## 读取剪贴板数据
## 存入到数据库
from py_function_tools import odps_read_sql,write_excle,write_to_database,hive_read_sql,odps_write_dataframe
from py_function_tools import odps_write_dataframe,write_database_from_odps
import pandas as pd
df = pd.read_clipboard(sep=‘\t‘)
df.head()
#去掉逗号
df_v1 = df.copy()
cols = df_v1.columns
cols = cols[1:]
df_v1[cols] = df_v1[cols].replace(‘,‘,‘‘)
df_v1.head()
###
cols
col = ‘大神超时未接单量(占比)‘
for col in cols:
df_v1[col] = df_v1[col].str.replace(‘,‘,‘‘)
df_v1[col] = df_v1[col].str.extract(r‘(\d+)‘, expand = False).fillna(‘‘)
df_v1.head()
原文:https://www.cnblogs.com/ministep/p/14416373.html